From acdba3f90b232fc12fcb200dca2584481b339118 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 23 Jul 2010 15:11:18 -0400 Subject: [PATCH] Prefer C linkage --- src/Makefile.am | 1 + src/check-c-linkage-decls.sh | 18 ++++++++++++++++++ src/hb-blob-private.h | 2 ++ src/hb-blob.c | 18 ++++++++++++------ src/hb-blob.h | 2 ++ src/hb-buffer-private.hh | 1 + src/hb-buffer.cc | 7 ++++++- src/hb-buffer.h | 1 + src/hb-common.c | 6 ++++++ src/hb-common.h | 21 +++++++++++++-------- src/hb-font-private.h | 1 + src/hb-font.cc | 4 ++++ src/hb-font.h | 1 + src/hb-ft.c | 10 ++++++++-- src/hb-ft.h | 2 ++ src/hb-glib.c | 6 ++++++ src/hb-glib.h | 2 ++ src/hb-graphite.cc | 6 ++++++ src/hb-graphite.h | 3 ++- src/hb-icu.c | 6 ++++++ src/hb-icu.h | 2 ++ src/hb-language.c | 5 +++++ src/hb-language.h | 2 ++ src/hb-object-private.h | 2 ++ src/hb-open-file-private.hh | 4 ++++ src/hb-open-type-private.hh | 5 +++++ src/hb-ot-head-private.hh | 5 +++++ src/hb-ot-layout-common-private.hh | 6 ++++++ src/hb-ot-layout-gdef-private.hh | 4 ++++ src/hb-ot-layout-gpos-private.hh | 6 ++++++ src/hb-ot-layout-gsub-private.hh | 7 ++++++- src/hb-ot-layout-gsubgpos-private.hh | 13 +++++++++++++ src/hb-ot-layout-private.hh | 3 ++- src/hb-ot-layout.cc | 5 +++++ src/hb-ot-layout.h | 1 + src/hb-ot-shape.cc | 6 ++++++ src/hb-ot-shape.h | 2 ++ src/hb-ot-tag.c | 5 +++++ src/hb-ot-tag.h | 2 ++ src/hb-ot.h | 3 +++ src/hb-private.h | 5 +++++ src/hb-shape.cc | 5 +++++ src/hb-shape.h | 1 + src/hb-unicode-private.h | 1 + src/hb-unicode.c | 6 ++++++ src/hb-unicode.h | 1 + src/hb.h | 3 +++ src/main.cc | 6 ++++++ 48 files changed, 214 insertions(+), 20 deletions(-) create mode 100755 src/check-c-linkage-decls.sh diff --git a/src/Makefile.am b/src/Makefile.am index a8ba69c24..409c93967 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -113,6 +113,7 @@ main_CPPFLAGS = $(HBCFLAGS) main_LDADD = libharfbuzz.la $(HBLIBS) TESTS = \ + check-c-linkage-decls.sh \ check-header-guards.sh \ check-internal-symbols.sh \ $(NULL) diff --git a/src/check-c-linkage-decls.sh b/src/check-c-linkage-decls.sh new file mode 100755 index 000000000..c262516db --- /dev/null +++ b/src/check-c-linkage-decls.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +LC_ALL=C +export LC_ALL + +test -z "$srcdir" && srcdir=. +stat=0 + +cd "$srcdir" + +for x in *.c *.cc *.h *.hh ; do + 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" + stat=1 + fi +done + +exit $stat diff --git a/src/hb-blob-private.h b/src/hb-blob-private.h index c91af65de..92109eda2 100644 --- a/src/hb-blob-private.h +++ b/src/hb-blob-private.h @@ -33,6 +33,7 @@ HB_BEGIN_DECLS + struct _hb_blob_t { hb_reference_count_t ref_count; @@ -52,6 +53,7 @@ struct _hb_blob_t { extern HB_INTERNAL hb_blob_t _hb_blob_nil; + HB_END_DECLS #endif /* HB_BLOB_PRIVATE_H */ diff --git a/src/hb-blob.c b/src/hb-blob.c index 0357fb433..926481dbd 100644 --- a/src/hb-blob.c +++ b/src/hb-blob.c @@ -35,13 +35,16 @@ #include #endif /* HAVE_SYS_MMAN_H */ +#include +#include + +HB_BEGIN_DECLS + + #ifndef HB_DEBUG_BLOB #define HB_DEBUG_BLOB HB_DEBUG+0 #endif -#include -#include - hb_blob_t _hb_blob_nil = { HB_REFERENCE_COUNT_INVALID, /* ref_count */ @@ -273,7 +276,7 @@ _try_make_writable_inplace_unix_locked (hb_blob_t *blob) } static void -_try_writable_inplace_locked (hb_blob_t *blob) +try_writable_inplace_locked (hb_blob_t *blob) { if (HB_DEBUG_BLOB) fprintf (stderr, "%p %s: making writable\n", blob, __FUNCTION__); @@ -301,7 +304,7 @@ hb_blob_try_writable_inplace (hb_blob_t *blob) hb_mutex_lock (blob->lock); if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE) - _try_writable_inplace_locked (blob); + try_writable_inplace_locked (blob); mode = blob->mode; @@ -321,7 +324,7 @@ hb_blob_try_writable (hb_blob_t *blob) hb_mutex_lock (blob->lock); if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE) - _try_writable_inplace_locked (blob); + try_writable_inplace_locked (blob); if (blob->mode == HB_MEMORY_MODE_READONLY) { @@ -354,3 +357,6 @@ done: return mode == HB_MEMORY_MODE_WRITABLE; } + + +HB_END_DECLS diff --git a/src/hb-blob.h b/src/hb-blob.h index d13bb0d52..dbbfc90a1 100644 --- a/src/hb-blob.h +++ b/src/hb-blob.h @@ -31,6 +31,7 @@ HB_BEGIN_DECLS + typedef enum { HB_MEMORY_MODE_DUPLICATE, HB_MEMORY_MODE_READONLY, @@ -82,6 +83,7 @@ hb_blob_try_writable_inplace (hb_blob_t *blob); hb_bool_t hb_blob_try_writable (hb_blob_t *blob); + HB_END_DECLS #endif /* HB_BLOB_H */ diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh index cfc781cae..b48ef1d57 100644 --- a/src/hb-buffer-private.hh +++ b/src/hb-buffer-private.hh @@ -34,6 +34,7 @@ HB_BEGIN_DECLS + #define HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN 0xFFFF diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index b04466ab9..ff393300a 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -29,6 +29,8 @@ #include +HB_BEGIN_DECLS + static hb_buffer_t _hb_buffer_nil = { HB_REFERENCE_COUNT_INVALID, /* ref_count */ @@ -96,7 +98,7 @@ _hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size) return likely (size <= buffer->allocated) ? TRUE : _hb_buffer_enlarge (buffer, size); } -static hb_bool_t +static inline hb_bool_t _hb_buffer_ensure_separate (hb_buffer_t *buffer, unsigned int size) { if (unlikely (!_hb_buffer_ensure (buffer, size))) return FALSE; @@ -692,3 +694,6 @@ hb_buffer_add_utf32 (hb_buffer_t *buffer, ADD_UTF (uint32_t); #undef UTF_NEXT } + + +HB_END_DECLS diff --git a/src/hb-buffer.h b/src/hb-buffer.h index 7b8b7ea8b..e6d477d03 100644 --- a/src/hb-buffer.h +++ b/src/hb-buffer.h @@ -34,6 +34,7 @@ HB_BEGIN_DECLS + typedef struct _hb_buffer_t hb_buffer_t; typedef struct _hb_glyph_info_t { diff --git a/src/hb-common.c b/src/hb-common.c index d205fc847..74f8933e9 100644 --- a/src/hb-common.c +++ b/src/hb-common.c @@ -26,6 +26,9 @@ #include "hb-private.h" +HB_BEGIN_DECLS + + hb_tag_t hb_tag_from_string (const char *s) { @@ -39,3 +42,6 @@ hb_tag_from_string (const char *s) return HB_TAG_STR (tag); } + + +HB_END_DECLS diff --git a/src/hb-common.h b/src/hb-common.h index 74d85122e..85906c566 100644 --- a/src/hb-common.h +++ b/src/hb-common.h @@ -27,6 +27,17 @@ #ifndef HB_COMMON_H #define HB_COMMON_H +# ifdef __cplusplus +# define HB_BEGIN_DECLS extern "C" { +# define HB_END_DECLS } +# else /* !__cplusplus */ +# define HB_BEGIN_DECLS +# define HB_END_DECLS +# endif /* !__cplusplus */ + +HB_BEGIN_DECLS + + #ifdef _MSC_VER #define _HB__STR2__(x) #x #define _HB__STR1__(x) _HB__STR2__(x) @@ -47,14 +58,6 @@ typedef unsigned long long uint64_t; #include #endif -# ifdef __cplusplus -# define HB_BEGIN_DECLS extern "C" { -# define HB_END_DECLS } -# else /* !__cplusplus */ -# define HB_BEGIN_DECLS -# define HB_END_DECLS -# endif /* !__cplusplus */ - typedef int hb_bool_t; typedef uint32_t hb_tag_t; @@ -88,4 +91,6 @@ typedef enum _hb_direction_t { #define HB_DIRECTION_REVERSE(dir) ((hb_direction_t) (((unsigned int) (dir)) ^ 1)) +HB_END_DECLS + #endif /* HB_COMMON_H */ diff --git a/src/hb-font-private.h b/src/hb-font-private.h index 7f54cbdca..f91da83b4 100644 --- a/src/hb-font-private.h +++ b/src/hb-font-private.h @@ -33,6 +33,7 @@ HB_BEGIN_DECLS + /* * hb_font_funcs_t */ diff --git a/src/hb-font.cc b/src/hb-font.cc index 8c4a608c1..a1535f1de 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -34,6 +34,8 @@ #include +HB_BEGIN_DECLS + /* * hb_font_funcs_t @@ -467,3 +469,5 @@ hb_font_set_ppem (hb_font_t *font, font->y_ppem = y_ppem; } + +HB_END_DECLS diff --git a/src/hb-font.h b/src/hb-font.h index 89324faa2..19247efa4 100644 --- a/src/hb-font.h +++ b/src/hb-font.h @@ -32,6 +32,7 @@ HB_BEGIN_DECLS + typedef struct _hb_face_t hb_face_t; typedef struct _hb_font_t hb_font_t; diff --git a/src/hb-ft.c b/src/hb-ft.c index bdf293651..86194562e 100644 --- a/src/hb-ft.c +++ b/src/hb-ft.c @@ -33,6 +33,9 @@ #include FT_TRUETYPE_TABLES_H +HB_BEGIN_DECLS + + static hb_codepoint_t hb_ft_get_glyph (hb_font_t *font HB_UNUSED, hb_face_t *face HB_UNUSED, @@ -145,7 +148,7 @@ hb_ft_get_font_funcs (void) static hb_blob_t * -_get_table (hb_tag_t tag, void *user_data) +get_table (hb_tag_t tag, void *user_data) { FT_Face ft_face = (FT_Face) user_data; FT_Byte *buffer; @@ -191,7 +194,7 @@ hb_ft_face_create (FT_Face ft_face, face = hb_face_create_for_data (blob, ft_face->face_index); hb_blob_destroy (blob); } else { - face = hb_face_create_for_tables (_get_table, destroy, ft_face); + face = hb_face_create_for_tables (get_table, destroy, ft_face); } return face; @@ -238,3 +241,6 @@ hb_ft_font_create (FT_Face ft_face, return font; } + + +HB_END_DECLS diff --git a/src/hb-ft.h b/src/hb-ft.h index d7dc97ef0..be5c85472 100644 --- a/src/hb-ft.h +++ b/src/hb-ft.h @@ -36,6 +36,7 @@ HB_BEGIN_DECLS + hb_font_funcs_t * hb_ft_get_font_funcs (void); @@ -51,6 +52,7 @@ hb_font_t * hb_ft_font_create (FT_Face ft_face, hb_destroy_func_t destroy); + HB_END_DECLS #endif /* HB_FT_H */ diff --git a/src/hb-glib.c b/src/hb-glib.c index d336c465c..c548fa693 100644 --- a/src/hb-glib.c +++ b/src/hb-glib.c @@ -32,6 +32,9 @@ #include +HB_BEGIN_DECLS + + static hb_codepoint_t hb_glib_get_mirroring (hb_codepoint_t unicode) { g_unichar_get_mirror_char (unicode, &unicode); return unicode; } static hb_category_t hb_glib_get_general_category (hb_codepoint_t unicode) { return g_unichar_type (unicode); } static hb_script_t hb_glib_get_script (hb_codepoint_t unicode) { return g_unichar_get_script (unicode); } @@ -56,3 +59,6 @@ hb_glib_get_unicode_funcs (void) { return &glib_ufuncs; } + + +HB_END_DECLS diff --git a/src/hb-glib.h b/src/hb-glib.h index 76f7676f7..81ab15d03 100644 --- a/src/hb-glib.h +++ b/src/hb-glib.h @@ -31,9 +31,11 @@ HB_BEGIN_DECLS + hb_unicode_funcs_t * hb_glib_get_unicode_funcs (void); + HB_END_DECLS #endif /* HB_GLIB_H */ diff --git a/src/hb-graphite.cc b/src/hb-graphite.cc index 8794db754..5d777efb2 100644 --- a/src/hb-graphite.cc +++ b/src/hb-graphite.cc @@ -33,6 +33,9 @@ #include "hb-graphite.h" #include +HB_BEGIN_DECLS + + namespace TtfUtil { extern int FontAscent(const void *pOS2); @@ -302,3 +305,6 @@ hb_graphite_shape (hb_font_t *font, delete[] firsts; delete[] flags; } + + +HB_END_DECLS diff --git a/src/hb-graphite.h b/src/hb-graphite.h index ac9ca272a..b5d1176ea 100644 --- a/src/hb-graphite.h +++ b/src/hb-graphite.h @@ -30,9 +30,9 @@ #include "hb-shape.h" - HB_BEGIN_DECLS + #define HB_GRAPHITE_TAG_Silf HB_TAG('S','i','l','f') void hb_graphite_shape (hb_font_t *font, @@ -41,6 +41,7 @@ void hb_graphite_shape (hb_font_t *font, hb_feature_t *features, unsigned int num_features); + HB_END_DECLS #endif /* HB_GRAPHITE_H */ diff --git a/src/hb-icu.c b/src/hb-icu.c index dc97a5416..44b92af22 100644 --- a/src/hb-icu.c +++ b/src/hb-icu.c @@ -35,6 +35,9 @@ #include #include +HB_BEGIN_DECLS + + static hb_codepoint_t hb_icu_get_mirroring (hb_codepoint_t unicode) { return u_charMirror(unicode); } static unsigned int hb_icu_get_combining_class (hb_codepoint_t unicode) { return u_getCombiningClass (unicode); } @@ -246,3 +249,6 @@ hb_icu_get_unicode_funcs (void) { return &icu_ufuncs; } + + +HB_END_DECLS diff --git a/src/hb-icu.h b/src/hb-icu.h index cdb55b412..cc17af8bb 100644 --- a/src/hb-icu.h +++ b/src/hb-icu.h @@ -31,9 +31,11 @@ HB_BEGIN_DECLS + hb_unicode_funcs_t * hb_icu_get_unicode_funcs (void); + HB_END_DECLS #endif /* HB_ICU_H */ diff --git a/src/hb-language.c b/src/hb-language.c index d57cbdfd1..2aabada8f 100644 --- a/src/hb-language.c +++ b/src/hb-language.c @@ -28,6 +28,9 @@ #include "hb-language.h" +HB_BEGIN_DECLS + + static const char canon_map[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -113,3 +116,5 @@ hb_language_to_string (hb_language_t language) return (const char *) language; } + +HB_END_DECLS diff --git a/src/hb-language.h b/src/hb-language.h index d366cad23..d3c91fb42 100644 --- a/src/hb-language.h +++ b/src/hb-language.h @@ -31,6 +31,7 @@ HB_BEGIN_DECLS + typedef const void *hb_language_t; hb_language_t @@ -39,6 +40,7 @@ hb_language_from_string (const char *str); const char * hb_language_to_string (hb_language_t language); + HB_END_DECLS #endif /* HB_LANGUAGE_H */ diff --git a/src/hb-object-private.h b/src/hb-object-private.h index 9fdd5641d..57f5f9460 100644 --- a/src/hb-object-private.h +++ b/src/hb-object-private.h @@ -32,6 +32,7 @@ #include "hb-private.h" +HB_BEGIN_DECLS /* Encapsulate operations on the object's reference count */ @@ -135,5 +136,6 @@ _hb_trace_object (const void *obj, } HB_STMT_END +HB_END_DECLS #endif /* HB_OBJECT_PRIVATE_H */ diff --git a/src/hb-open-file-private.hh b/src/hb-open-file-private.hh index 9570b0fba..0782f6515 100644 --- a/src/hb-open-file-private.hh +++ b/src/hb-open-file-private.hh @@ -29,6 +29,8 @@ #include "hb-open-type-private.hh" +HB_BEGIN_DECLS + /* * @@ -251,4 +253,6 @@ struct OpenTypeFontFile }; +HB_END_DECLS + #endif /* HB_OPEN_FILE_PRIVATE_HH */ diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index a0ecc2e8c..ae01ef971 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -31,6 +31,8 @@ #include "hb-blob.h" +HB_BEGIN_DECLS +HB_END_DECLS /* @@ -728,4 +730,7 @@ struct SortedArrayOf : ArrayOf { }; +HB_BEGIN_DECLS +HB_END_DECLS + #endif /* HB_OPEN_TYPE_PRIVATE_HH */ diff --git a/src/hb-ot-head-private.hh b/src/hb-ot-head-private.hh index faf0282a9..a3e87a996 100644 --- a/src/hb-ot-head-private.hh +++ b/src/hb-ot-head-private.hh @@ -29,6 +29,9 @@ #include "hb-open-type-private.hh" +HB_BEGIN_DECLS + + /* * head */ @@ -125,4 +128,6 @@ struct head }; +HB_END_DECLS + #endif /* HB_OT_HEAD_PRIVATE_HH */ diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index 5c90c27a9..c4a40554a 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -36,6 +36,9 @@ #define NOT_COVERED ((unsigned int) 0x110000) #define MAX_NESTING_LEVEL 8 +HB_BEGIN_DECLS +HB_END_DECLS + /* * @@ -574,4 +577,7 @@ struct Device }; +HB_BEGIN_DECLS +HB_END_DECLS + #endif /* HB_OT_LAYOUT_COMMON_PRIVATE_HH */ diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh index 2f77ef498..549e4b7de 100644 --- a/src/hb-ot-layout-gdef-private.hh +++ b/src/hb-ot-layout-gdef-private.hh @@ -31,6 +31,8 @@ #include "hb-font-private.h" +HB_BEGIN_DECLS + /* * Attachment List Table @@ -397,4 +399,6 @@ struct GDEF }; +HB_END_DECLS + #endif /* HB_OT_LAYOUT_GDEF_PRIVATE_HH */ diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index 77cbbeba2..00fa7ef0d 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -29,6 +29,8 @@ #include "hb-ot-layout-gsubgpos-private.hh" +HB_BEGIN_DECLS + #define HB_OT_LAYOUT_GPOS_NO_LAST ((unsigned int) -1) @@ -1373,7 +1375,9 @@ struct MarkMarkPos }; +HB_BEGIN_DECLS static inline bool position_lookup (hb_apply_context_t *c, unsigned int lookup_index); +HB_END_DECLS struct ContextPos : Context { @@ -1627,4 +1631,6 @@ static inline bool position_lookup (hb_apply_context_t *c, unsigned int lookup_i } +HB_END_DECLS + #endif /* HB_OT_LAYOUT_GPOS_PRIVATE_HH */ diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index 9af5b63f3..f09b4d26e 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -29,6 +29,8 @@ #include "hb-ot-layout-gsubgpos-private.hh" +HB_BEGIN_DECLS + struct SingleSubstFormat1 { @@ -541,8 +543,9 @@ struct LigatureSubst }; - +HB_BEGIN_DECLS static inline bool substitute_lookup (hb_apply_context_t *c, unsigned int lookup_index); +HB_END_DECLS struct ContextSubst : Context { @@ -936,4 +939,6 @@ static inline bool substitute_lookup (hb_apply_context_t *c, unsigned int lookup } +HB_END_DECLS + #endif /* HB_OT_LAYOUT_GSUB_PRIVATE_HH */ diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index a3274b0b7..c13cddf2f 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -30,6 +30,8 @@ #include "hb-buffer-private.hh" #include "hb-ot-layout-gdef-private.hh" +HB_BEGIN_DECLS + #ifndef HB_DEBUG_APPLY #define HB_DEBUG_APPLY HB_DEBUG+0 @@ -39,6 +41,8 @@ hb_trace_t trace (&c->debug_depth, "APPLY", HB_FUNC, this); \ +HB_BEGIN_DECLS + struct hb_apply_context_t { unsigned int debug_depth; @@ -164,6 +168,8 @@ static inline bool match_lookahead (hb_apply_context_t *c, return true; } +HB_END_DECLS + struct LookupRecord { @@ -180,6 +186,9 @@ struct LookupRecord DEFINE_SIZE_STATIC (4); }; + +HB_BEGIN_DECLS + static inline bool apply_lookup (hb_apply_context_t *c, unsigned int count, /* Including the first glyph */ unsigned int lookupCount, @@ -236,6 +245,8 @@ static inline bool apply_lookup (hb_apply_context_t *c, return true; } +HB_END_DECLS + /* Contextual lookups */ @@ -939,4 +950,6 @@ struct GSUBGPOS }; +HB_END_DECLS + #endif /* HB_OT_LAYOUT_GSUBGPOS_PRIVATE_HH */ diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index 8d0d4694f..8e041ba85 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -35,9 +35,9 @@ #include "hb-font-private.h" #include "hb-buffer-private.hh" - HB_BEGIN_DECLS + typedef unsigned int hb_ot_layout_class_t; /* @@ -119,6 +119,7 @@ _hb_ot_layout_skip_mark (hb_face_t *face, unsigned int lookup_flags, unsigned int *property); + HB_END_DECLS #endif /* HB_OT_LAYOUT_PRIVATE_HH */ diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index 82b56c8d6..c39b63e21 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -38,6 +38,8 @@ #include #include +HB_BEGIN_DECLS + hb_ot_layout_t * _hb_ot_layout_new (hb_face_t *face) @@ -644,3 +646,6 @@ hb_ot_layout_position_finish (hb_font_t *font HB_UNUSED, } } } + + +HB_END_DECLS diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h index d8c862b93..e1b63818d 100644 --- a/src/hb-ot-layout.h +++ b/src/hb-ot-layout.h @@ -35,6 +35,7 @@ HB_BEGIN_DECLS + #define HB_OT_TAG_GDEF HB_TAG('G','D','E','F') #define HB_OT_TAG_GSUB HB_TAG('G','S','U','B') #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S') diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 027f72532..3c2195303 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -32,6 +32,9 @@ #include "hb-ot-layout.h" +HB_BEGIN_DECLS + + /* XXX vertical */ hb_tag_t default_features[] = { HB_TAG('c','a','l','t'), @@ -625,3 +628,6 @@ hb_ot_shape (hb_font_t *font, buffer->direction = original_direction; } + + +HB_END_DECLS diff --git a/src/hb-ot-shape.h b/src/hb-ot-shape.h index 1fafb8e40..182d951a3 100644 --- a/src/hb-ot-shape.h +++ b/src/hb-ot-shape.h @@ -32,6 +32,7 @@ HB_BEGIN_DECLS + void hb_ot_shape (hb_font_t *font, hb_face_t *face, @@ -39,6 +40,7 @@ hb_ot_shape (hb_font_t *font, hb_feature_t *features, unsigned int num_features); + HB_END_DECLS #endif /* HB_OT_SHAPE_H */ diff --git a/src/hb-ot-tag.c b/src/hb-ot-tag.c index 2d9db6628..448f795cc 100644 --- a/src/hb-ot-tag.c +++ b/src/hb-ot-tag.c @@ -29,6 +29,8 @@ #include +HB_BEGIN_DECLS + /* * Complete list at: @@ -694,3 +696,6 @@ hb_ot_tag_to_language (hb_tag_t tag) buf[10] = '\0'; return hb_language_from_string ((char *) buf); } + + +HB_END_DECLS diff --git a/src/hb-ot-tag.h b/src/hb-ot-tag.h index 6d15d4e28..1eec69f96 100644 --- a/src/hb-ot-tag.h +++ b/src/hb-ot-tag.h @@ -32,6 +32,7 @@ HB_BEGIN_DECLS + #define HB_OT_TAG_DEFAULT_SCRIPT HB_TAG ('D', 'F', 'L', 'T') #define HB_OT_TAG_DEFAULT_LANGUAGE HB_TAG ('d', 'f', 'l', 't') @@ -47,6 +48,7 @@ hb_ot_tag_from_language (hb_language_t language); hb_language_t hb_ot_tag_to_language (hb_tag_t tag); + HB_END_DECLS #endif /* HB_OT_TAG_H */ diff --git a/src/hb-ot.h b/src/hb-ot.h index 91992b8c2..268711d43 100644 --- a/src/hb-ot.h +++ b/src/hb-ot.h @@ -33,4 +33,7 @@ #include "hb-ot-shape.h" #include "hb-ot-tag.h" +HB_BEGIN_DECLS +HB_END_DECLS + #endif /* HB_OT_H */ diff --git a/src/hb-private.h b/src/hb-private.h index 6b0a95785..ad7c3629f 100644 --- a/src/hb-private.h +++ b/src/hb-private.h @@ -44,6 +44,8 @@ #include #include +HB_BEGIN_DECLS + /* Essentials */ @@ -259,4 +261,7 @@ _hb_trace (const char *what, #include "hb-object-private.h" + +HB_END_DECLS + #endif /* HB_PRIVATE_H */ diff --git a/src/hb-shape.cc b/src/hb-shape.cc index 45bdc9122..a73977b46 100644 --- a/src/hb-shape.cc +++ b/src/hb-shape.cc @@ -36,6 +36,8 @@ #include "hb-graphite.h" #endif +HB_BEGIN_DECLS + void hb_shape (hb_font_t *font, @@ -58,3 +60,6 @@ hb_shape (hb_font_t *font, hb_ot_shape (font, face, buffer, features, num_features); } + + +HB_END_DECLS diff --git a/src/hb-shape.h b/src/hb-shape.h index d5210f3b8..48f1a557c 100644 --- a/src/hb-shape.h +++ b/src/hb-shape.h @@ -33,6 +33,7 @@ HB_BEGIN_DECLS + typedef struct _hb_feature_t { hb_tag_t tag; uint32_t value; diff --git a/src/hb-unicode-private.h b/src/hb-unicode-private.h index 9bb566e27..419404b87 100644 --- a/src/hb-unicode-private.h +++ b/src/hb-unicode-private.h @@ -33,6 +33,7 @@ HB_BEGIN_DECLS + /* * hb_unicode_funcs_t */ diff --git a/src/hb-unicode.c b/src/hb-unicode.c index b237fbbc3..2de963e13 100644 --- a/src/hb-unicode.c +++ b/src/hb-unicode.c @@ -28,6 +28,9 @@ #include "hb-unicode-private.h" +HB_BEGIN_DECLS + + /* * hb_unicode_funcs_t */ @@ -313,3 +316,6 @@ _hb_script_get_horizontal_direction (hb_script_t script) return horiz_dir[script]; } + + +HB_END_DECLS diff --git a/src/hb-unicode.h b/src/hb-unicode.h index 2f4f69bb0..8aeba3377 100644 --- a/src/hb-unicode.h +++ b/src/hb-unicode.h @@ -31,6 +31,7 @@ HB_BEGIN_DECLS + /* Unicode General Category property */ typedef enum { diff --git a/src/hb.h b/src/hb.h index 905fd7b47..691adee73 100644 --- a/src/hb.h +++ b/src/hb.h @@ -35,4 +35,7 @@ #include "hb-shape.h" #include "hb-unicode.h" +HB_BEGIN_DECLS +HB_END_DECLS + #endif /* HB_H */ diff --git a/src/main.cc b/src/main.cc index 5d68862ae..083908eaa 100644 --- a/src/main.cc +++ b/src/main.cc @@ -35,6 +35,9 @@ #include #include +HB_BEGIN_DECLS + + int main (int argc, char **argv) { @@ -188,3 +191,6 @@ main (int argc, char **argv) return 0; } + + +HB_END_DECLS