diff --git a/src/hb-private.h b/src/hb-private.h index 8d885aa497c89fa23c01743977d2bd8f5d8c598f..933abea327e7f1f585d86fafe229ccce828f9a95 100644 --- a/src/hb-private.h +++ b/src/hb-private.h @@ -46,10 +46,6 @@ #include "hb-common.h" -#define hb_be_uint8 -#define hb_be_int8 -#define hb_be_uint16(v) ((uint16_t) hb_be_int16 ((uint16_t) v)) -#define hb_be_uint32(v) ((uint32_t) hb_be_int32 ((uint32_t) v)) /* We need external help for these */ @@ -57,10 +53,6 @@ #include -/* Macros to convert to/from BigEndian */ -#define hb_be_int16(v) GINT16_FROM_BE (v) -#define hb_be_int32(v) GINT32_FROM_BE (v) - typedef int hb_atomic_int_t; #define hb_atomic_int_fetch_and_add(AI, V) g_atomic_int_exchange_and_add (&(AI), V) #define hb_atomic_int_get(AI) g_atomic_int_get (&(AI)) @@ -78,6 +70,8 @@ typedef GStaticMutex hb_mutex_t; #endif +#define hb_be_uint16(v) ((uint16_t) ((((const uint8_t *)&(v))[0] >> 8) + (((const uint8_t *)&(v))[1] << 8))) + #define hb_be_uint8_put_unaligned(v,V) (v[0] = (V), 0) #define hb_be_uint8_get_unaligned(v) (uint8_t) (v[0]) #define hb_be_uint8_cmp_unaligned(a,b) (a[0] == b[0])