Minor cleanup, add LIKELY and UNLIKELY annotations
[framework/uifw/harfbuzz.git] / src / hb-private.h
1 #ifndef HB_PRIVATE_H
2 #define HB_PRIVATE_H
3
4 #include <glib.h>
5
6 /* Macros to convert to/from BigEndian */
7 #define hb_be_uint8_t
8 #define hb_be_int8_t
9 #define hb_be_uint16_t  GUINT16_TO_BE
10 #define hb_be_int16_t   GINT16_TO_BE
11 #define hb_be_uint32_t  GUINT32_TO_BE
12 #define hb_be_int32_t   GINT32_TO_BE
13 #define hb_be_uint64_t  GUINT64_TO_BE
14 #define hb_be_int64_t   GINT64_TO_BE
15
16 #define HB_LIKELY       G_LIKEYLY
17 #define HB_UNLIKELY     G_UNLIKELY
18
19 #include <assert.h>
20
21 #define _ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
22 #define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
23 #define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))
24
25 #define ASSERT_SIZE(_type, _size) ASSERT_STATIC (sizeof (_type) == (_size))
26
27 #endif /* HB_PRIVATE_H */