Catches compile-errors in them better.
/* Compiler attributes */
+template <typename T>
+struct _hb_alignof
+{
+ struct s
+ {
+ char c;
+ T t;
+ };
+ static constexpr unsigned int value = offsetof (s, t);
+};
+
#if __cplusplus < 201103L
#ifndef nullptr
#ifndef alignof
#define alignof(x) (_hb_alignof<x>::value)
-template <typename T>
-struct _hb_alignof
-{
- struct s
- {
- char c;
- T t;
- };
- static constexpr unsigned int value = offsetof (s, t);
-};
#endif // alignof
#endif // __cplusplus < 201103L
/* fallback for round() */
-#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND)
static inline double
_hb_round (double x)
{
else
return ceil (x - 0.5);
}
+#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND)
#define round(x) _hb_round(x)
#endif