Undo default unicode-funcs to avoid static initializer again
This commit is contained in:
parent
093171ccec
commit
be4560a3b5
|
@ -37,7 +37,7 @@
|
|||
#define HB_DEBUG_BUFFER (HB_DEBUG+0)
|
||||
#endif
|
||||
|
||||
#define _HB_BUFFER_UNICODE_FUNCS_DEFAULT _hb_unicode_funcs_default
|
||||
#define _HB_BUFFER_UNICODE_FUNCS_DEFAULT (const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_default))
|
||||
#define _HB_BUFFER_PROPS_DEFAULT { HB_DIRECTION_INVALID, HB_SCRIPT_INVALID, HB_LANGUAGE_INVALID }
|
||||
|
||||
/* Here is how the buffer works internally:
|
||||
|
|
|
@ -337,21 +337,22 @@ hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
|
|||
}
|
||||
|
||||
|
||||
extern HB_INTERNAL const hb_unicode_funcs_t _hb_glib_unicode_funcs;
|
||||
const hb_unicode_funcs_t _hb_glib_unicode_funcs = {
|
||||
HB_OBJECT_HEADER_STATIC,
|
||||
|
||||
NULL, /* parent */
|
||||
TRUE, /* immutable */
|
||||
{
|
||||
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_glib_unicode_##name,
|
||||
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
||||
#undef HB_UNICODE_FUNC_IMPLEMENT
|
||||
}
|
||||
};
|
||||
|
||||
hb_unicode_funcs_t *
|
||||
hb_glib_get_unicode_funcs (void)
|
||||
{
|
||||
static const hb_unicode_funcs_t _hb_glib_unicode_funcs = {
|
||||
HB_OBJECT_HEADER_STATIC,
|
||||
|
||||
NULL, /* parent */
|
||||
TRUE, /* immutable */
|
||||
{
|
||||
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_glib_unicode_##name,
|
||||
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
||||
#undef HB_UNICODE_FUNC_IMPLEMENT
|
||||
}
|
||||
};
|
||||
|
||||
return const_cast<hb_unicode_funcs_t *> (&_hb_glib_unicode_funcs);
|
||||
}
|
||||
|
||||
|
|
|
@ -269,21 +269,23 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
extern HB_INTERNAL const hb_unicode_funcs_t _hb_icu_unicode_funcs;
|
||||
const hb_unicode_funcs_t _hb_icu_unicode_funcs = {
|
||||
HB_OBJECT_HEADER_STATIC,
|
||||
|
||||
NULL, /* parent */
|
||||
TRUE, /* immutable */
|
||||
{
|
||||
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_icu_unicode_##name,
|
||||
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
||||
#undef HB_UNICODE_FUNC_IMPLEMENT
|
||||
}
|
||||
};
|
||||
|
||||
hb_unicode_funcs_t *
|
||||
hb_icu_get_unicode_funcs (void)
|
||||
{
|
||||
static const hb_unicode_funcs_t _hb_icu_unicode_funcs = {
|
||||
HB_OBJECT_HEADER_STATIC,
|
||||
|
||||
NULL, /* parent */
|
||||
TRUE, /* immutable */
|
||||
{
|
||||
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_icu_unicode_##name,
|
||||
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
||||
#undef HB_UNICODE_FUNC_IMPLEMENT
|
||||
}
|
||||
};
|
||||
|
||||
return const_cast<hb_unicode_funcs_t *> (&_hb_icu_unicode_funcs);
|
||||
}
|
||||
|
||||
|
|
|
@ -91,14 +91,14 @@ struct _hb_unicode_funcs_t {
|
|||
|
||||
|
||||
#ifdef HAVE_GLIB
|
||||
extern "C" hb_unicode_funcs_t * hb_glib_get_unicode_funcs (void);
|
||||
#define _hb_unicode_funcs_default hb_glib_get_unicode_funcs ()
|
||||
extern HB_INTERNAL const hb_unicode_funcs_t _hb_glib_unicode_funcs;
|
||||
#define _hb_unicode_funcs_default _hb_glib_unicode_funcs
|
||||
#elif defined(HAVE_ICU)
|
||||
extern "C" hb_unicode_funcs_t * hb_icu_get_unicode_funcs (void);
|
||||
#define _hb_unicode_funcs_default hb_icu_get_unicode_funcs ()
|
||||
extern HB_INTERNAL const hb_unicode_funcs_t _hb_icu_unicode_funcs;
|
||||
#define _hb_unicode_funcs_default _hb_icu_unicode_funcs
|
||||
#else
|
||||
#define HB_UNICODE_FUNCS_NIL 1
|
||||
#define _hb_unicode_funcs_default hb_unicode_funcs_get_empty ()
|
||||
#define _hb_unicode_funcs_default _hb_unicode_funcs_nil
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ hb_unicode_decompose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED,
|
|||
hb_unicode_funcs_t *
|
||||
hb_unicode_funcs_get_default (void)
|
||||
{
|
||||
return _hb_unicode_funcs_default;
|
||||
return const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_default);
|
||||
}
|
||||
|
||||
hb_unicode_funcs_t *
|
||||
|
@ -130,21 +130,23 @@ hb_unicode_funcs_create (hb_unicode_funcs_t *parent)
|
|||
return ufuncs;
|
||||
}
|
||||
|
||||
|
||||
extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
|
||||
const hb_unicode_funcs_t _hb_unicode_funcs_nil = {
|
||||
HB_OBJECT_HEADER_STATIC,
|
||||
|
||||
NULL, /* parent */
|
||||
TRUE, /* immutable */
|
||||
{
|
||||
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_nil,
|
||||
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
||||
#undef HB_UNICODE_FUNC_IMPLEMENT
|
||||
}
|
||||
};
|
||||
|
||||
hb_unicode_funcs_t *
|
||||
hb_unicode_funcs_get_empty (void)
|
||||
{
|
||||
static const hb_unicode_funcs_t _hb_unicode_funcs_nil = {
|
||||
HB_OBJECT_HEADER_STATIC,
|
||||
|
||||
NULL, /* parent */
|
||||
TRUE, /* immutable */
|
||||
{
|
||||
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_nil,
|
||||
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
||||
#undef HB_UNICODE_FUNC_IMPLEMENT
|
||||
}
|
||||
};
|
||||
|
||||
return const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_nil);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue