From a98d0ab18624501ee60551304f2715361ac643da Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 13 Jul 2012 10:19:10 -0400 Subject: [PATCH] Make sure HB_BEGIN_DECLS / HB_END_DECLS is only used in public headers So we can use them to switch default visibility to internal if desired, and use these to make only declared symbols public. --- src/check-c-linkage-decls.sh | 10 +++++++++- src/hb-fallback-shape-private.hh | 6 ------ src/hb-ot-shape-complex-indic-machine.rl | 4 ---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/check-c-linkage-decls.sh b/src/check-c-linkage-decls.sh index e7c95abc..44cdfa0f 100755 --- a/src/check-c-linkage-decls.sh +++ b/src/check-c-linkage-decls.sh @@ -7,12 +7,20 @@ test -z "$srcdir" && srcdir=. stat=0 test "x$HBHEADERS" = x && HBHEADERS=`find . -maxdepth 1 -name 'hb*.h'` +test "x$HBSOURCES" = x && HBSOURCES=`find . -maxdepth 1 -name 'hb*.h'` for x in $HBHEADERS; do test -f $srcdir/$x && x=$srcdir/$x if ! grep -q HB_BEGIN_DECLS "$x" || ! grep -q HB_END_DECLS "$x"; then - echo "Ouch, file $x does not HB_BEGIN_DECLS / HB_END_DECLS" + echo "Ouch, file $x does not have HB_BEGIN_DECLS / HB_END_DECLS, but it should" + stat=1 + fi +done +for x in $HBSOURCES; do + test -f $srcdir/$x && x=$srcdir/$x + if grep -q HB_BEGIN_DECLS "$x" || grep -q HB_END_DECLS "$x"; then + echo "Ouch, file $x has HB_BEGIN_DECLS / HB_END_DECLS, but it shouldn't" stat=1 fi done diff --git a/src/hb-fallback-shape-private.hh b/src/hb-fallback-shape-private.hh index 159456d2..0ef155c1 100644 --- a/src/hb-fallback-shape-private.hh +++ b/src/hb-fallback-shape-private.hh @@ -32,16 +32,10 @@ #include "hb-shape.h" -HB_BEGIN_DECLS - - HB_INTERNAL hb_bool_t _hb_fallback_shape (hb_font_t *font, hb_buffer_t *buffer, const hb_feature_t *features, unsigned int num_features); - -HB_END_DECLS - #endif /* HB_FALLBACK_SHAPE_PRIVATE_HH */ diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl index 93ca29a7..7dcbb063 100644 --- a/src/hb-ot-shape-complex-indic-machine.rl +++ b/src/hb-ot-shape-complex-indic-machine.rl @@ -29,8 +29,6 @@ #include "hb-private.hh" -HB_BEGIN_DECLS - %%{ machine indic_syllable_machine; alphtype unsigned char; @@ -110,6 +108,4 @@ find_syllables (const hb_ot_map_t *map, hb_buffer_t *buffer, hb_mask_t *mask_arr }%% } -HB_END_DECLS - #endif /* HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH */ -- GitLab