[HarfBuzz] harfbuzz-ng: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Feb 23 12:14:03 PST 2012


 src/Makefile.am          |    1 +
 src/hb-mutex-private.hh  |    6 +++---
 src/hb-object-private.hh |   11 +++--------
 3 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit bd7ff1dec5b92ee59fa060e793f88499adcd8c11
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Feb 23 15:06:16 2012 -0500

    Allow disabling multi-threaded support
    
    By defining HB_NO_MT.
    
    Also, only warn once per missing MT feature support.
    
    Mozilla Bug 666661 - gfx/harfbuzz/src/hb-prive.h - compiler warnings on mac

diff --git a/src/Makefile.am b/src/Makefile.am
index 8e8c013..d747895 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -38,6 +38,7 @@ HBSOURCES =  \
 	hb-tt-font.cc \
 	hb-unicode-private.hh \
 	hb-unicode.cc \
+	hb-warning.cc \
 	$(NULL)
 HBHEADERS = \
 	hb.h \
diff --git a/src/hb-mutex-private.hh b/src/hb-mutex-private.hh
index 9855a56..88442d1 100644
--- a/src/hb-mutex-private.hh
+++ b/src/hb-mutex-private.hh
@@ -40,7 +40,7 @@
 
 /* We need external help for these */
 
-#ifdef HAVE_GLIB
+#if !defined(HB_NO_MT) && defined(HAVE_GLIB)
 
 #include <glib.h>
 
@@ -52,7 +52,7 @@ typedef GStaticMutex hb_mutex_impl_t;
 #define hb_mutex_impl_free(M)	g_static_mutex_free (M)
 
 
-#elif defined(_MSC_VER) || defined(__MINGW32__)
+#elif !defined(HB_NO_MT) && defined(_MSC_VER) || defined(__MINGW32__)
 
 #include <windows.h>
 
@@ -66,7 +66,7 @@ typedef CRITICAL_SECTION hb_mutex_impl_t;
 
 #else
 
-#warning "Could not find any system to define platform macros, library will NOT be thread-safe"
+#define HB_MUTEX_IMPL_NIL 1
 
 typedef volatile int hb_mutex_impl_t;
 #define HB_MUTEX_IMPL_INIT	0
diff --git a/src/hb-object-private.hh b/src/hb-object-private.hh
index 2e4a385..6fa0f09 100644
--- a/src/hb-object-private.hh
+++ b/src/hb-object-private.hh
@@ -49,7 +49,7 @@
 
 /* We need external help for these */
 
-#ifdef HAVE_GLIB
+#if !defined(HB_NO_MT) && defined(HAVE_GLIB)
 
 #include <glib.h>
 
@@ -63,7 +63,7 @@ typedef volatile int hb_atomic_int_t;
 #define hb_atomic_int_set(AI, V)	g_atomic_int_set (&(AI), V)
 
 
-#elif defined(_MSC_VER) && _MSC_VER >= 1600
+#elif !defined(HB_NO_MT) && defined(_MSC_VER) && _MSC_VER >= 1600
 
 #include <intrin.h>
 
@@ -75,18 +75,13 @@ typedef long hb_atomic_int_t;
 
 #else
 
-#ifdef _MSC_VER
-#pragma message("Could not find any system to define atomic_int macros, library will NOT be thread-safe")
-#else
-#warning "Could not find any system to define atomic_int macros, library will NOT be thread-safe"
-#endif
+#define HB_ATOMIC_INT_NIL 1
 
 typedef volatile int hb_atomic_int_t;
 #define hb_atomic_int_add(AI, V)	((AI) += (V), (AI) - (V))
 #define hb_atomic_int_get(AI)		(AI)
 #define hb_atomic_int_set(AI, V)	((void) ((AI) = (V)))
 
-
 #endif
 
 



More information about the HarfBuzz mailing list