[HarfBuzz] harfbuzz-ng: Branch 'master' - 2 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Wed Jun 6 08:30:28 PDT 2012
src/hb-private.hh | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
New commits:
commit 73cb02de2dd28b09d4aa76230132248215cfe83d
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Jun 6 11:29:25 2012 -0400
Minor
diff --git a/src/hb-private.hh b/src/hb-private.hh
index 07c9fb6..0cb049e 100644
--- a/src/hb-private.hh
+++ b/src/hb-private.hh
@@ -78,9 +78,9 @@ template <typename Type> static inline Type MAX (const Type &a, const Type &b) {
#define HB_STMT_START do
#define HB_STMT_END while (0)
-#define _ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
-#define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
-#define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))
+#define _ASSERT_STATIC1(_line, _cond) typedef int _static_assert_on_line_##_line##_failed[(_cond)?1:-1]
+#define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
+#define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))
#define ASSERT_STATIC_EXPR(_cond)((void) sizeof (char[(_cond) ? 1 : -1]))
#define ASSERT_STATIC_EXPR_ZERO(_cond) (0 * sizeof (char[(_cond) ? 1 : -1]))
@@ -107,9 +107,9 @@ ASSERT_STATIC (sizeof (hb_var_int_t) == 4);
/* We like our types POD */
-#define _ASSERT_TYPE_POD1(_line, _type) union _type_##_type##_on_line_##_line##_is_not_POD { _type instance; }
-#define _ASSERT_TYPE_POD0(_line, _type) _ASSERT_TYPE_POD1 (_line, _type)
-#define ASSERT_TYPE_POD(_type) _ASSERT_TYPE_POD0 (__LINE__, _type)
+#define _ASSERT_TYPE_POD1(_line, _type) union _type_##_type##_on_line_##_line##_is_not_POD { _type instance; }
+#define _ASSERT_TYPE_POD0(_line, _type) _ASSERT_TYPE_POD1 (_line, _type)
+#define ASSERT_TYPE_POD(_type) _ASSERT_TYPE_POD0 (__LINE__, _type)
#ifdef __GNUC__
# define _ASSERT_INSTANCE_POD1(_line, _instance) \
@@ -118,17 +118,17 @@ ASSERT_STATIC (sizeof (hb_var_int_t) == 4);
_ASSERT_TYPE_POD1 (_line, _type_##_line); \
} HB_STMT_END
#else
-# define _ASSERT_INSTANCE_POD1(_line, _instance) typedef int _assertion_on_line_##_line##_not_tested
+# define _ASSERT_INSTANCE_POD1(_line, _instance) typedef int _assertion_on_line_##_line##_not_tested
#endif
-# define _ASSERT_INSTANCE_POD0(_line, _instance) _ASSERT_INSTANCE_POD1 (_line, _instance)
-# define ASSERT_INSTANCE_POD(_instance) _ASSERT_INSTANCE_POD0 (__LINE__, _instance)
+# define _ASSERT_INSTANCE_POD0(_line, _instance) _ASSERT_INSTANCE_POD1 (_line, _instance)
+# define ASSERT_INSTANCE_POD(_instance) _ASSERT_INSTANCE_POD0 (__LINE__, _instance)
/* Check _assertion in a method environment */
#define _ASSERT_POD1(_line) \
- inline void _static_assertion_on_line_##_line (void) const \
- { _ASSERT_INSTANCE_POD1 (_line, *this); /* Make sure it's POD. */ }
-# define _ASSERT_POD0(_line) _ASSERT_POD1 (_line)
-# define ASSERT_POD() _ASSERT_POD0 (__LINE__)
+ inline void _static_assertion_on_line_##_line (void) const \
+ { _ASSERT_INSTANCE_POD1 (_line, *this); /* Make sure it's POD. */ }
+# define _ASSERT_POD0(_line) _ASSERT_POD1 (_line)
+# define ASSERT_POD() _ASSERT_POD0 (__LINE__)
commit 79e2b4791fe95ede9a1e6b1c71ccc6e36c4fc0e5
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Jun 6 11:27:17 2012 -0400
Fix ASSERT_POD on clang
As reported by bashi. Not tested.
diff --git a/src/hb-private.hh b/src/hb-private.hh
index 2ea0442..07c9fb6 100644
--- a/src/hb-private.hh
+++ b/src/hb-private.hh
@@ -82,7 +82,7 @@ template <typename Type> static inline Type MAX (const Type &a, const Type &b) {
#define _ASSERT_STATIC0(_line, _cond) _ASSERT_STATIC1 (_line, (_cond))
#define ASSERT_STATIC(_cond) _ASSERT_STATIC0 (__LINE__, (_cond))
-#define ASSERT_STATIC_EXPR(_cond) ((void) sizeof (char[(_cond) ? 1 : -1]))
+#define ASSERT_STATIC_EXPR(_cond)((void) sizeof (char[(_cond) ? 1 : -1]))
#define ASSERT_STATIC_EXPR_ZERO(_cond) (0 * sizeof (char[(_cond) ? 1 : -1]))
#define _PASTE1(a,b) a##b
@@ -112,7 +112,11 @@ ASSERT_STATIC (sizeof (hb_var_int_t) == 4);
#define ASSERT_TYPE_POD(_type) _ASSERT_TYPE_POD0 (__LINE__, _type)
#ifdef __GNUC__
-# define _ASSERT_INSTANCE_POD1(_line, _instance) union _type_of_instance_on_line_##_line##_is_not_POD { __typeof__(_instance) instance; }
+# define _ASSERT_INSTANCE_POD1(_line, _instance) \
+ HB_STMT_START { \
+ typedef __typeof__(_instance) _type_##_line; \
+ _ASSERT_TYPE_POD1 (_line, _type_##_line); \
+ } HB_STMT_END
#else
# define _ASSERT_INSTANCE_POD1(_line, _instance) typedef int _assertion_on_line_##_line##_not_tested
#endif
More information about the HarfBuzz
mailing list