diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh index 8307a549d..a82ce6cf3 100644 --- a/src/hb-atomic.hh +++ b/src/hb-atomic.hh @@ -107,7 +107,7 @@ _hb_atomic_ptr_impl_cmplexch (const void **P, const void *O_, const void *N) static inline void _hb_memory_barrier () { -#if !defined(MemoryBarrier) +#ifndef MemoryBarrier /* MinGW has a convoluted history of supporting MemoryBarrier. */ LONG dummy = 0; InterlockedExchange (&dummy, 1); diff --git a/src/hb-debug.hh b/src/hb-debug.hh index a03170b08..e6d06e310 100644 --- a/src/hb-debug.hh +++ b/src/hb-debug.hh @@ -63,7 +63,7 @@ extern HB_INTERNAL hb_atomic_int_t _hb_options; static inline hb_options_t hb_options () { -#if defined(HB_NO_GETENV) +#ifdef HB_NO_GETENV return hb_options_t (); #endif /* Make a local copy, so we can access bitfield threadsafely. */ diff --git a/src/hb-font.cc b/src/hb-font.cc index 20daefd27..c00f33329 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -1347,7 +1347,7 @@ hb_font_create (hb_face_t *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. */ hb_ot_font_set_funcs (font); #endif diff --git a/src/hb-ot-font.cc b/src/hb-ot-font.cc index 77e42cc53..5051fa0ea 100644 --- a/src/hb-ot-font.cc +++ b/src/hb-ot-font.cc @@ -183,13 +183,13 @@ hb_ot_get_glyph_extents (hb_font_t *font, bool ret = ot_face->sbix->get_extents (font, glyph, extents); if (!ret) ret = ot_face->glyf->get_extents (glyph, extents); -#if !defined(HB_NO_OT_FONT_CFF) +#ifndef HB_NO_OT_FONT_CFF if (!ret) ret = ot_face->cff1->get_extents (glyph, extents); if (!ret) ret = ot_face->cff2->get_extents (font, glyph, extents); #endif -#if !defined(HB_NO_OT_FONT_BITMAP) +#ifndef HB_NO_OT_FONT_BITMAP if (!ret) ret = ot_face->CBDT->get_extents (font, glyph, extents); #endif diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 817b28e68..cd603d8d0 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -138,7 +138,7 @@ bool OT::GDEF::is_blacklisted (hb_blob_t *blob, hb_face_t *face) const { -#if defined(HB_NO_OT_LAYOUT_BLACKLIST) +#ifdef HB_NO_OT_LAYOUT_BLACKLIST return false; #endif /* 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, hb_face_t *face) const { -#if defined(HB_NO_OT_LAYOUT_BLACKLIST) +#ifdef HB_NO_OT_LAYOUT_BLACKLIST return false; #endif /* 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, hb_face_t *face HB_UNUSED) const { -#if defined(HB_NO_OT_LAYOUT_BLACKLIST) +#ifdef HB_NO_OT_LAYOUT_BLACKLIST return false; #endif return false; diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh index f2f5a1a53..e7e32ecf8 100644 --- a/src/hb-ot-name-table.hh +++ b/src/hb-ot-name-table.hh @@ -60,7 +60,7 @@ struct NameRecord if (p == 1) 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) return _hb_aat_language_get (face, l); #endif diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc index 4daf2a666..3212e0c96 100644 --- a/src/hb-ot-shape-complex-arabic.cc +++ b/src/hb-ot-shape-complex-arabic.cc @@ -383,7 +383,7 @@ arabic_fallback_shape (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { -#if defined(HB_NO_OT_SHAPE_COMPLEX_ARABIC_FALLBACK) +#ifdef HB_NO_OT_SHAPE_COMPLEX_ARABIC_FALLBACK return; #endif diff --git a/src/hb-ot-shape-complex-hebrew.cc b/src/hb-ot-shape-complex-hebrew.cc index db8801814..14989730f 100644 --- a/src/hb-ot-shape-complex-hebrew.cc +++ b/src/hb-ot-shape-complex-hebrew.cc @@ -70,7 +70,7 @@ compose_hebrew (const hb_ot_shape_normalize_context_t *c, 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; #endif diff --git a/src/hb-ot-shape-complex-thai.cc b/src/hb-ot-shape-complex-thai.cc index 130ea1c98..22d4aa3ab 100644 --- a/src/hb-ot-shape-complex-thai.cc +++ b/src/hb-ot-shape-complex-thai.cc @@ -218,7 +218,7 @@ do_thai_pua_shaping (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_buffer_t *buffer, hb_font_t *font) { -#if defined(HB_NO_OT_SHAPE_COMPLEX_THAI_FALLBACK) +#ifdef HB_NO_OT_SHAPE_COMPLEX_THAI_FALLBACK return; #endif diff --git a/src/hb-ot-shape-complex-vowel-constraints.cc b/src/hb-ot-shape-complex-vowel-constraints.cc index 2eb313ae4..912ee35b4 100644 --- a/src/hb-ot-shape-complex-vowel-constraints.cc +++ b/src/hb-ot-shape-complex-vowel-constraints.cc @@ -34,7 +34,7 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_buffer_t *buffer, hb_font_t *font HB_UNUSED) { -#if defined(HB_NO_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS) +#ifdef HB_NO_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS return; #endif if (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE) diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc index b10eec666..42b728fd1 100644 --- a/src/hb-ot-shape-fallback.cc +++ b/src/hb-ot-shape-fallback.cc @@ -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_buffer_t *buffer) { -#if defined(HB_NO_OT_SHAPE_FALLBACK) +#ifdef HB_NO_OT_SHAPE_FALLBACK return; #endif @@ -438,7 +438,7 @@ _hb_ot_shape_fallback_mark_position (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer, bool adjust_offsets_when_zeroing) { -#if defined(HB_NO_OT_SHAPE_FALLBACK) +#ifdef HB_NO_OT_SHAPE_FALLBACK return; #endif @@ -481,7 +481,7 @@ _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { -#if defined(HB_NO_OT_SHAPE_FALLBACK) +#ifdef HB_NO_OT_SHAPE_FALLBACK return; #endif diff --git a/src/hb-subset.cc b/src/hb-subset.cc index f4fc77172..aa6934bc3 100644 --- a/src/hb-subset.cc +++ b/src/hb-subset.cc @@ -206,7 +206,7 @@ _subset_table (hb_subset_plan_t *plan, result = _subset (plan); break; -#if !defined(HB_NO_SUBSET_LAYOUT) +#ifndef HB_NO_SUBSET_LAYOUT case HB_OT_TAG_GDEF: result = _subset2 (plan); 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_GPOS: case HB_OT_TAG_GSUB: -#if defined(HB_NO_SUBSET_LAYOUT) +#ifdef HB_NO_SUBSET_LAYOUT return true; #endif return plan->drop_layout; diff --git a/src/hb-warning.cc b/src/hb-warning.cc index 9fb410038..60c7445b7 100644 --- a/src/hb-warning.cc +++ b/src/hb-warning.cc @@ -26,12 +26,12 @@ #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 "Check hb-atomic.hh for possible resolutions." #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 "Check hb-mutex.hh for possible resolutions." #endif diff --git a/src/hb.hh b/src/hb.hh index 3d4b18033..0aa55af16 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -30,7 +30,7 @@ #define HB_HH #ifndef HB_NO_PRAGMA_GCC_DIAGNOSTIC -#if defined(_MSC_VER) +#ifdef _MSC_VER #pragma warning( disable: 4068 ) /* Unknown pragma */ #endif #if defined(__GNUC__) || defined(__clang__) @@ -203,7 +203,7 @@ extern "C" void hb_free_impl(void *ptr); #define realloc hb_realloc_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); #define posix_memalign hb_memalign_impl #else @@ -315,7 +315,7 @@ extern "C" int hb_memalign_impl(void **memptr, size_t alignment, size_t size); # define HB_FALLTHROUGH /* FALLTHROUGH */ #endif -#if defined(__clang__) +#ifdef __clang__ /* Disable certain sanitizer errors. */ /* https://github.com/harfbuzz/harfbuzz/issues/1247 */ #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 */ -#if !defined(HB_VECTOR_SIZE) +#ifndef HB_VECTOR_SIZE # define HB_VECTOR_SIZE 0 #endif /* The `vector_size' attribute was introduced in gcc 3.1. */ -#if !defined(HB_VECTOR_SIZE) +#ifndef HB_VECTOR_SIZE # if defined( __GNUC__ ) && ( __GNUC__ >= 4 ) # define HB_VECTOR_SIZE 128 # else