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.
This commit is contained in:
Behdad Esfahbod 2012-07-13 10:19:10 -04:00
parent 5c5bc96216
commit a98d0ab186
3 changed files with 9 additions and 11 deletions

View File

@ -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

View File

@ -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 */

View File

@ -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 */