[llvm-commits] [compiler-rt] r102671 - in /compiler-rt/trunk/BlocksRuntime: Block_private.h runtime.c
Charles Davis
cdavis at mines.edu
Thu Apr 29 16:44:00 PDT 2010
Author: cdavis
Date: Thu Apr 29 18:44:00 2010
New Revision: 102671
URL: http://llvm.org/viewvc/llvm-project?rev=102671&view=rev
Log:
Fix build with MSVC.
Modified:
compiler-rt/trunk/BlocksRuntime/Block_private.h
compiler-rt/trunk/BlocksRuntime/runtime.c
Modified: compiler-rt/trunk/BlocksRuntime/Block_private.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/Block_private.h?rev=102671&r1=102670&r2=102671&view=diff
==============================================================================
--- compiler-rt/trunk/BlocksRuntime/Block_private.h (original)
+++ compiler-rt/trunk/BlocksRuntime/Block_private.h Thu Apr 29 18:44:00 2010
@@ -33,7 +33,14 @@
# endif
#endif
+#ifndef _MSC_VER
#include <stdbool.h>
+#else
+/* MSVC doesn't have <stdbool.h>. Compensate. */
+typedef char bool;
+#define true (bool)1
+#define false (bool)0
+#endif
#if defined(__cplusplus)
extern "C" {
Modified: compiler-rt/trunk/BlocksRuntime/runtime.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/BlocksRuntime/runtime.c?rev=102671&r1=102670&r2=102671&view=diff
==============================================================================
--- compiler-rt/trunk/BlocksRuntime/runtime.c (original)
+++ compiler-rt/trunk/BlocksRuntime/runtime.c Thu Apr 29 18:44:00 2010
@@ -27,7 +27,6 @@
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
-#include <stdbool.h>
#include "config.h"
@@ -45,7 +44,7 @@
#include <libkern/OSAtomic.h>
#endif /* HAVE_LIBKERN_OSATOMIC_H */
-#elif defined(__WIN32__)
+#elif defined(__WIN32__) || defined(_WIN32)
#define _CRT_SECURE_NO_WARNINGS 1
#include <windows.h>
More information about the llvm-commits
mailing list