mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-20 14:31:10 +01:00
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
This commit is contained in:
1 parent
634c9e3423
commit
bd7ff1dec5
3 files changed
+7
-11
No files matched your search
@@ -38,6 +38,7 @@ HBSOURCES = \
|
||||
hb-tt-font.cc \
|
||||
hb-unicode-private.hh \
|
||||
hb-unicode.cc \
|
||||
hb-warning.cc \
|
||||
$(NULL)
|
||||
HBHEADERS = \
|
||||
hb.h \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user