diff --git a/src/hb-ucdn.cc b/src/hb-ucdn.cc index ed26ba2d1..35063043f 100644 --- a/src/hb-ucdn.cc +++ b/src/hb-ucdn.cc @@ -18,9 +18,7 @@ #include "hb-unicode-private.hh" -HB_BEGIN_DECLS #include "ucdn.h" -HB_END_DECLS static const hb_script_t ucdn_script_translate[] = { diff --git a/src/hb-ucdn/ucdn.h b/src/hb-ucdn/ucdn.h index 7fba6153d..802f044a8 100644 --- a/src/hb-ucdn/ucdn.h +++ b/src/hb-ucdn/ucdn.h @@ -17,6 +17,23 @@ #ifndef UCDN_H #define UCDN_H +#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__MINGW32__) +# define HB_BEGIN_VISIBILITY _Pragma ("GCC visibility push(hidden)") +# define HB_END_VISIBILITY _Pragma ("GCC visibility pop") +#else +# define HB_BEGIN_VISIBILITY +# define HB_END_VISIBILITY +#endif +#ifdef __cplusplus +# define HB_BEGIN_HEADER extern "C" { HB_BEGIN_VISIBILITY +# define HB_END_HEADER HB_END_VISIBILITY } +#else +# define HB_BEGIN_HEADER HB_BEGIN_VISIBILITY +# define HB_END_HEADER HB_END_VISIBILITY +#endif + +HB_BEGIN_HEADER + #include #define UCDN_EAST_ASIAN_F 0 @@ -287,4 +304,6 @@ int ucdn_compat_decompose(uint32_t code, uint32_t *decomposed); */ int ucdn_compose(uint32_t *code, uint32_t a, uint32_t b); +HB_END_HEADER + #endif