From: Behdad Esfahbod Date: Fri, 23 Jul 2010 19:11:18 +0000 (-0400) Subject: Prefer C linkage X-Git-Tag: submit/master/20120920.151126~7^2~563 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=acdba3f90b232fc12fcb200dca2584481b339118;p=framework%2Fuifw%2Fharfbuzz.git Prefer C linkage --- diff --git a/src/Makefile.am b/src/Makefile.am index a8ba69c..409c939 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 0000000..c262516 --- /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 c91af65..92109ed 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 0357fb4..926481d 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 d13bb0d..dbbfc90 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 cfc781c..b48ef1d 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 b04466a..ff39330 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 7b8b7ea..e6d477d 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 d205fc8..74f8933 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 74d8512..85906c5 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 7f54cbd..f91da83 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 8c4a608..a1535f1 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 89324fa..19247ef 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 bdf2936..8619456 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 d7dc97e..be5c854 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 d336c46..c548fa6 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 76f7676..81ab15d 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 8794db7..5d777ef 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 ac9ca27..b5d1176 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 dc97a54..44b92af 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 cdb55b4..cc17af8 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 d57cbdf..2aabada 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 d366cad..d3c91fb 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 9fdd564..57f5f94 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 9570b0f..0782f65 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 a0ecc2e..ae01ef9 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 faf0282..a3e87a9 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 5c90c27..c4a4055 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 2f77ef4..549e4b7 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 77cbbeb..00fa7ef 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 9af5b63..f09b4d2 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 a3274b0..c13cddf 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 8d0d469..8e041ba 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 82b56c8..c39b63e 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 d8c862b..e1b6381 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 027f725..3c21953 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 1fafb8e..182d951 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 2d9db66..448f795 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 6d15d4e..1eec69f 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 91992b8..268711d 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 6b0a957..ad7c362 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 45bdc91..a73977b 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 d5210f3..48f1a55 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 9bb566e..419404b 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 b237fbb..2de963e 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 2f4f69b..8aeba33 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 905fd7b..691adee 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 5d68862..083908e 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