Fix build around true/false
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 3 Jan 2013 00:57:47 +0000 (18:57 -0600)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 3 Jan 2013 00:57:47 +0000 (18:57 -0600)
src/fcatomic.h
src/fcinit.c

index 073809e..72ae372 100644 (file)
@@ -94,7 +94,7 @@ typedef volatile int fc_atomic_int_t;
 #define fc_atomic_int_add(AI, V)       (((AI) += (V)) - (V))
 
 #define fc_atomic_ptr_get(P)           ((void *) *(P))
-#define fc_atomic_ptr_cmpexch(P,O,N)   (* (void * volatile *) (P) == (void *) (O) ? (* (void * volatile *) (P) = (void *) (N), true) : false)
+#define fc_atomic_ptr_cmpexch(P,O,N)   (* (void * volatile *) (P) == (void *) (O) ? (* (void * volatile *) (P) = (void *) (N), FcTrue) : FcFalse)
 
 
 #else /* FC_NO_MT */
@@ -103,7 +103,7 @@ typedef int fc_atomic_int_t;
 #define fc_atomic_int_add(AI, V)       (((AI) += (V)) - (V))
 
 #define fc_atomic_ptr_get(P)           ((void *) *(P))
-#define fc_atomic_ptr_cmpexch(P,O,N)   (* (void **) (P) == (void *) (O) ? (* (void **) (P) = (void *) (N), true) : false)
+#define fc_atomic_ptr_cmpexch(P,O,N)   (* (void **) (P) == (void *) (O) ? (* (void **) (P) = (void *) (N), FcTrue) : FcFalse)
 
 #endif
 
index 146fbc1..2360764 100644 (file)
 #include "fcint.h"
 #include <stdlib.h>
 
+#if defined(FC_ATOMIC_INT_NIL)
+#pragma message("Could not find any system to define atomic_int macros, library may NOT be thread-safe.")
+#endif
+#if defined(FC_MUTEX_IMPL_NIL)
+#pragma message("Could not find any system to define mutex macros, library may NOT be thread-safe.")
+#endif
+#if defined(FC_ATOMIC_INT_NIL) || defined(FC_MUTEX_IMPL_NIL)
+#pragma message("To suppress these warnings, define FC_NO_MT.")
+#endif
+
 static FcConfig *
 FcInitFallbackConfig (void)
 {