This commit is contained in:
Behdad Esfahbod 2019-05-10 23:15:58 -07:00
parent 9bfe22af61
commit 227d85e138
14 changed files with 25 additions and 25 deletions

View File

@ -107,7 +107,7 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N)
static inline void _hb_memory_barrier () static inline void _hb_memory_barrier ()
{ {
#if !defined(MemoryBarrier) #ifndef MemoryBarrier
/* MinGW has a convoluted history of supporting MemoryBarrier. */ /* MinGW has a convoluted history of supporting MemoryBarrier. */
LONG dummy = 0; LONG dummy = 0;
InterlockedExchange (&dummy, 1); InterlockedExchange (&dummy, 1);

View File

@ -63,7 +63,7 @@ extern HB_INTERNAL hb_atomic_int_t _hb_options;
static inline hb_options_t static inline hb_options_t
hb_options () hb_options ()
{ {
#if defined(HB_NO_GETENV) #ifdef HB_NO_GETENV
return hb_options_t (); return hb_options_t ();
#endif #endif
/* Make a local copy, so we can access bitfield threadsafely. */ /* Make a local copy, so we can access bitfield threadsafely. */

View File

@ -1347,7 +1347,7 @@ hb_font_create (hb_face_t *face)
{ {
hb_font_t *font = _hb_font_create (face); hb_font_t *font = _hb_font_create (face);
#if !defined(HB_NO_OT_FONT) #ifndef HB_NO_OT_FONT
/* Install our in-house, very lightweight, funcs. */ /* Install our in-house, very lightweight, funcs. */
hb_ot_font_set_funcs (font); hb_ot_font_set_funcs (font);
#endif #endif

View File

@ -183,13 +183,13 @@ hb_ot_get_glyph_extents (hb_font_t *font,
bool ret = ot_face->sbix->get_extents (font, glyph, extents); bool ret = ot_face->sbix->get_extents (font, glyph, extents);
if (!ret) if (!ret)
ret = ot_face->glyf->get_extents (glyph, extents); ret = ot_face->glyf->get_extents (glyph, extents);
#if !defined(HB_NO_OT_FONT_CFF) #ifndef HB_NO_OT_FONT_CFF
if (!ret) if (!ret)
ret = ot_face->cff1->get_extents (glyph, extents); ret = ot_face->cff1->get_extents (glyph, extents);
if (!ret) if (!ret)
ret = ot_face->cff2->get_extents (font, glyph, extents); ret = ot_face->cff2->get_extents (font, glyph, extents);
#endif #endif
#if !defined(HB_NO_OT_FONT_BITMAP) #ifndef HB_NO_OT_FONT_BITMAP
if (!ret) if (!ret)
ret = ot_face->CBDT->get_extents (font, glyph, extents); ret = ot_face->CBDT->get_extents (font, glyph, extents);
#endif #endif

View File

@ -138,7 +138,7 @@ bool
OT::GDEF::is_blacklisted (hb_blob_t *blob, OT::GDEF::is_blacklisted (hb_blob_t *blob,
hb_face_t *face) const hb_face_t *face) const
{ {
#if defined(HB_NO_OT_LAYOUT_BLACKLIST) #ifdef HB_NO_OT_LAYOUT_BLACKLIST
return false; return false;
#endif #endif
/* The ugly business of blacklisting individual fonts' tables happen here! /* The ugly business of blacklisting individual fonts' tables happen here!
@ -384,7 +384,7 @@ bool
OT::GSUB::is_blacklisted (hb_blob_t *blob HB_UNUSED, OT::GSUB::is_blacklisted (hb_blob_t *blob HB_UNUSED,
hb_face_t *face) const hb_face_t *face) const
{ {
#if defined(HB_NO_OT_LAYOUT_BLACKLIST) #ifdef HB_NO_OT_LAYOUT_BLACKLIST
return false; return false;
#endif #endif
/* Mac OS X prefers morx over GSUB. It also ships with various Indic fonts, /* Mac OS X prefers morx over GSUB. It also ships with various Indic fonts,
@ -412,7 +412,7 @@ bool
OT::GPOS::is_blacklisted (hb_blob_t *blob HB_UNUSED, OT::GPOS::is_blacklisted (hb_blob_t *blob HB_UNUSED,
hb_face_t *face HB_UNUSED) const hb_face_t *face HB_UNUSED) const
{ {
#if defined(HB_NO_OT_LAYOUT_BLACKLIST) #ifdef HB_NO_OT_LAYOUT_BLACKLIST
return false; return false;
#endif #endif
return false; return false;

View File

@ -60,7 +60,7 @@ struct NameRecord
if (p == 1) if (p == 1)
return _hb_ot_name_language_for_mac_code (l); return _hb_ot_name_language_for_mac_code (l);
#if !defined(HB_NO_NAME_TABLE_AAT) #ifndef HB_NO_NAME_TABLE_AAT
if (p == 0) if (p == 0)
return _hb_aat_language_get (face, l); return _hb_aat_language_get (face, l);
#endif #endif

View File

@ -383,7 +383,7 @@ arabic_fallback_shape (const hb_ot_shape_plan_t *plan,
hb_font_t *font, hb_font_t *font,
hb_buffer_t *buffer) hb_buffer_t *buffer)
{ {
#if defined(HB_NO_OT_SHAPE_COMPLEX_ARABIC_FALLBACK) #ifdef HB_NO_OT_SHAPE_COMPLEX_ARABIC_FALLBACK
return; return;
#endif #endif

View File

@ -70,7 +70,7 @@ compose_hebrew (const hb_ot_shape_normalize_context_t *c,
bool found = (bool) c->unicode->compose (a, b, ab); bool found = (bool) c->unicode->compose (a, b, ab);
#if defined(HB_NO_OT_SHAPE_COMPLEX_HEBREW_FALLBACK) #ifdef HB_NO_OT_SHAPE_COMPLEX_HEBREW_FALLBACK
return found; return found;
#endif #endif

View File

@ -218,7 +218,7 @@ do_thai_pua_shaping (const hb_ot_shape_plan_t *plan HB_UNUSED,
hb_buffer_t *buffer, hb_buffer_t *buffer,
hb_font_t *font) hb_font_t *font)
{ {
#if defined(HB_NO_OT_SHAPE_COMPLEX_THAI_FALLBACK) #ifdef HB_NO_OT_SHAPE_COMPLEX_THAI_FALLBACK
return; return;
#endif #endif

View File

@ -34,7 +34,7 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
hb_buffer_t *buffer, hb_buffer_t *buffer,
hb_font_t *font HB_UNUSED) hb_font_t *font HB_UNUSED)
{ {
#if defined(HB_NO_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS) #ifdef HB_NO_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS
return; return;
#endif #endif
if (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE) if (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE)

View File

@ -166,7 +166,7 @@ _hb_ot_shape_fallback_mark_position_recategorize_marks (const hb_ot_shape_plan_t
hb_font_t *font HB_UNUSED, hb_font_t *font HB_UNUSED,
hb_buffer_t *buffer) hb_buffer_t *buffer)
{ {
#if defined(HB_NO_OT_SHAPE_FALLBACK) #ifdef HB_NO_OT_SHAPE_FALLBACK
return; return;
#endif #endif
@ -438,7 +438,7 @@ _hb_ot_shape_fallback_mark_position (const hb_ot_shape_plan_t *plan,
hb_buffer_t *buffer, hb_buffer_t *buffer,
bool adjust_offsets_when_zeroing) bool adjust_offsets_when_zeroing)
{ {
#if defined(HB_NO_OT_SHAPE_FALLBACK) #ifdef HB_NO_OT_SHAPE_FALLBACK
return; return;
#endif #endif
@ -481,7 +481,7 @@ _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan,
hb_font_t *font, hb_font_t *font,
hb_buffer_t *buffer) hb_buffer_t *buffer)
{ {
#if defined(HB_NO_OT_SHAPE_FALLBACK) #ifdef HB_NO_OT_SHAPE_FALLBACK
return; return;
#endif #endif

View File

@ -206,7 +206,7 @@ _subset_table (hb_subset_plan_t *plan,
result = _subset<const OT::VORG> (plan); result = _subset<const OT::VORG> (plan);
break; break;
#if !defined(HB_NO_SUBSET_LAYOUT) #ifndef HB_NO_SUBSET_LAYOUT
case HB_OT_TAG_GDEF: case HB_OT_TAG_GDEF:
result = _subset2<const OT::GDEF> (plan); result = _subset2<const OT::GDEF> (plan);
break; break;
@ -247,7 +247,7 @@ _should_drop_table (hb_subset_plan_t *plan, hb_tag_t tag)
case HB_OT_TAG_GDEF: case HB_OT_TAG_GDEF:
case HB_OT_TAG_GPOS: case HB_OT_TAG_GPOS:
case HB_OT_TAG_GSUB: case HB_OT_TAG_GSUB:
#if defined(HB_NO_SUBSET_LAYOUT) #ifdef HB_NO_SUBSET_LAYOUT
return true; return true;
#endif #endif
return plan->drop_layout; return plan->drop_layout;

View File

@ -26,12 +26,12 @@
#include "hb.hh" #include "hb.hh"
#if defined(HB_ATOMIC_INT_NIL) #ifdef HB_ATOMIC_INT_NIL
#error "Could not find any system to define atomic_int macros, library WILL NOT be thread-safe" #error "Could not find any system to define atomic_int macros, library WILL NOT be thread-safe"
#error "Check hb-atomic.hh for possible resolutions." #error "Check hb-atomic.hh for possible resolutions."
#endif #endif
#if defined(HB_MUTEX_IMPL_NIL) #ifdef HB_MUTEX_IMPL_NIL
#error "Could not find any system to define mutex macros, library WILL NOT be thread-safe" #error "Could not find any system to define mutex macros, library WILL NOT be thread-safe"
#error "Check hb-mutex.hh for possible resolutions." #error "Check hb-mutex.hh for possible resolutions."
#endif #endif

View File

@ -30,7 +30,7 @@
#define HB_HH #define HB_HH
#ifndef HB_NO_PRAGMA_GCC_DIAGNOSTIC #ifndef HB_NO_PRAGMA_GCC_DIAGNOSTIC
#if defined(_MSC_VER) #ifdef _MSC_VER
#pragma warning( disable: 4068 ) /* Unknown pragma */ #pragma warning( disable: 4068 ) /* Unknown pragma */
#endif #endif
#if defined(__GNUC__) || defined(__clang__) #if defined(__GNUC__) || defined(__clang__)
@ -203,7 +203,7 @@ extern "C" void hb_free_impl(void *ptr);
#define realloc hb_realloc_impl #define realloc hb_realloc_impl
#define free hb_free_impl #define free hb_free_impl
#if defined(hb_memalign_impl) #ifdef hb_memalign_impl
extern "C" int hb_memalign_impl(void **memptr, size_t alignment, size_t size); extern "C" int hb_memalign_impl(void **memptr, size_t alignment, size_t size);
#define posix_memalign hb_memalign_impl #define posix_memalign hb_memalign_impl
#else #else
@ -315,7 +315,7 @@ extern "C" int hb_memalign_impl(void **memptr, size_t alignment, size_t size);
# define HB_FALLTHROUGH /* FALLTHROUGH */ # define HB_FALLTHROUGH /* FALLTHROUGH */
#endif #endif
#if defined(__clang__) #ifdef __clang__
/* Disable certain sanitizer errors. */ /* Disable certain sanitizer errors. */
/* https://github.com/harfbuzz/harfbuzz/issues/1247 */ /* https://github.com/harfbuzz/harfbuzz/issues/1247 */
#define HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW __attribute__((no_sanitize("signed-integer-overflow"))) #define HB_NO_SANITIZE_SIGNED_INTEGER_OVERFLOW __attribute__((no_sanitize("signed-integer-overflow")))
@ -445,12 +445,12 @@ static_assert ((sizeof (hb_var_int_t) == 4), "");
* *
* https://bugs.chromium.org/p/chromium/issues/detail?id=860184 * https://bugs.chromium.org/p/chromium/issues/detail?id=860184
*/ */
#if !defined(HB_VECTOR_SIZE) #ifndef HB_VECTOR_SIZE
# define HB_VECTOR_SIZE 0 # define HB_VECTOR_SIZE 0
#endif #endif
/* The `vector_size' attribute was introduced in gcc 3.1. */ /* The `vector_size' attribute was introduced in gcc 3.1. */
#if !defined(HB_VECTOR_SIZE) #ifndef HB_VECTOR_SIZE
# if defined( __GNUC__ ) && ( __GNUC__ >= 4 ) # if defined( __GNUC__ ) && ( __GNUC__ >= 4 )
# define HB_VECTOR_SIZE 128 # define HB_VECTOR_SIZE 128
# else # else