aboutsummaryrefslogtreecommitdiff
path: root/BlocksRuntime
diff options
context:
space:
mode:
authorCharles Davis <cdavis@mines.edu>2010-04-29 23:44:00 +0000
committerCharles Davis <cdavis@mines.edu>2010-04-29 23:44:00 +0000
commitffd69e7b181a486cbba10deb386558cf3ff5e24a (patch)
treed70f47c7a961f443d0d421cecfdb15aa117ec546 /BlocksRuntime
parentafb7b6e421785106a7e13e13c2a5320e3f1d9bd3 (diff)
downloadcompiler-rt-ffd69e7b181a486cbba10deb386558cf3ff5e24a.tar.gz
Fix build with MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@102671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'BlocksRuntime')
-rw-r--r--BlocksRuntime/Block_private.h7
-rw-r--r--BlocksRuntime/runtime.c3
2 files changed, 8 insertions, 2 deletions
diff --git a/BlocksRuntime/Block_private.h b/BlocksRuntime/Block_private.h
index 7b069d899..8ae821815 100644
--- a/BlocksRuntime/Block_private.h
+++ b/BlocksRuntime/Block_private.h
@@ -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" {
diff --git a/BlocksRuntime/runtime.c b/BlocksRuntime/runtime.c
index dae06321f..a059c2234 100644
--- a/BlocksRuntime/runtime.c
+++ b/BlocksRuntime/runtime.c
@@ -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>