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)
|
#define HB_DEBUG_BUFFER (HB_DEBUG+0)
|
||||||
#endif
|
#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 }
|
#define _HB_BUFFER_PROPS_DEFAULT { HB_DIRECTION_INVALID, HB_SCRIPT_INVALID, HB_LANGUAGE_INVALID }
|
||||||
|
|
||||||
/* Here is how the buffer works internally:
|
/* Here is how the buffer works internally:
|
||||||
|
|
|
@ -337,10 +337,8 @@ hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
hb_unicode_funcs_t *
|
extern HB_INTERNAL const hb_unicode_funcs_t _hb_glib_unicode_funcs;
|
||||||
hb_glib_get_unicode_funcs (void)
|
const hb_unicode_funcs_t _hb_glib_unicode_funcs = {
|
||||||
{
|
|
||||||
static const hb_unicode_funcs_t _hb_glib_unicode_funcs = {
|
|
||||||
HB_OBJECT_HEADER_STATIC,
|
HB_OBJECT_HEADER_STATIC,
|
||||||
|
|
||||||
NULL, /* parent */
|
NULL, /* parent */
|
||||||
|
@ -350,8 +348,11 @@ hb_glib_get_unicode_funcs (void)
|
||||||
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
||||||
#undef HB_UNICODE_FUNC_IMPLEMENT
|
#undef HB_UNICODE_FUNC_IMPLEMENT
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hb_unicode_funcs_t *
|
||||||
|
hb_glib_get_unicode_funcs (void)
|
||||||
|
{
|
||||||
return const_cast<hb_unicode_funcs_t *> (&_hb_glib_unicode_funcs);
|
return const_cast<hb_unicode_funcs_t *> (&_hb_glib_unicode_funcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -269,10 +269,9 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_unicode_funcs_t *
|
|
||||||
hb_icu_get_unicode_funcs (void)
|
extern HB_INTERNAL const hb_unicode_funcs_t _hb_icu_unicode_funcs;
|
||||||
{
|
const hb_unicode_funcs_t _hb_icu_unicode_funcs = {
|
||||||
static const hb_unicode_funcs_t _hb_icu_unicode_funcs = {
|
|
||||||
HB_OBJECT_HEADER_STATIC,
|
HB_OBJECT_HEADER_STATIC,
|
||||||
|
|
||||||
NULL, /* parent */
|
NULL, /* parent */
|
||||||
|
@ -282,8 +281,11 @@ hb_icu_get_unicode_funcs (void)
|
||||||
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
||||||
#undef HB_UNICODE_FUNC_IMPLEMENT
|
#undef HB_UNICODE_FUNC_IMPLEMENT
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hb_unicode_funcs_t *
|
||||||
|
hb_icu_get_unicode_funcs (void)
|
||||||
|
{
|
||||||
return const_cast<hb_unicode_funcs_t *> (&_hb_icu_unicode_funcs);
|
return const_cast<hb_unicode_funcs_t *> (&_hb_icu_unicode_funcs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,14 +91,14 @@ struct _hb_unicode_funcs_t {
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_GLIB
|
#ifdef HAVE_GLIB
|
||||||
extern "C" hb_unicode_funcs_t * hb_glib_get_unicode_funcs (void);
|
extern HB_INTERNAL const hb_unicode_funcs_t _hb_glib_unicode_funcs;
|
||||||
#define _hb_unicode_funcs_default hb_glib_get_unicode_funcs ()
|
#define _hb_unicode_funcs_default _hb_glib_unicode_funcs
|
||||||
#elif defined(HAVE_ICU)
|
#elif defined(HAVE_ICU)
|
||||||
extern "C" hb_unicode_funcs_t * hb_icu_get_unicode_funcs (void);
|
extern HB_INTERNAL const hb_unicode_funcs_t _hb_icu_unicode_funcs;
|
||||||
#define _hb_unicode_funcs_default hb_icu_get_unicode_funcs ()
|
#define _hb_unicode_funcs_default _hb_icu_unicode_funcs
|
||||||
#else
|
#else
|
||||||
#define HB_UNICODE_FUNCS_NIL 1
|
#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
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ hb_unicode_decompose_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED,
|
||||||
hb_unicode_funcs_t *
|
hb_unicode_funcs_t *
|
||||||
hb_unicode_funcs_get_default (void)
|
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 *
|
hb_unicode_funcs_t *
|
||||||
|
@ -130,10 +130,9 @@ hb_unicode_funcs_create (hb_unicode_funcs_t *parent)
|
||||||
return ufuncs;
|
return ufuncs;
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_unicode_funcs_t *
|
|
||||||
hb_unicode_funcs_get_empty (void)
|
extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
|
||||||
{
|
const hb_unicode_funcs_t _hb_unicode_funcs_nil = {
|
||||||
static const hb_unicode_funcs_t _hb_unicode_funcs_nil = {
|
|
||||||
HB_OBJECT_HEADER_STATIC,
|
HB_OBJECT_HEADER_STATIC,
|
||||||
|
|
||||||
NULL, /* parent */
|
NULL, /* parent */
|
||||||
|
@ -143,8 +142,11 @@ hb_unicode_funcs_get_empty (void)
|
||||||
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
|
||||||
#undef HB_UNICODE_FUNC_IMPLEMENT
|
#undef HB_UNICODE_FUNC_IMPLEMENT
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hb_unicode_funcs_t *
|
||||||
|
hb_unicode_funcs_get_empty (void)
|
||||||
|
{
|
||||||
return const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_nil);
|
return const_cast<hb_unicode_funcs_t *> (&_hb_unicode_funcs_nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue