From 2aae617a84f47836f10efd30df43e13e3a9447e1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Jul 2018 17:27:23 +0200 Subject: [PATCH] Move _hb_alignof later again It uses constexpr... --- src/hb-private.hh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/hb-private.hh b/src/hb-private.hh index 74b9e274b..ddb256f80 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -84,19 +84,9 @@ extern "C" int hb_memalign_impl(void **memptr, size_t alignment, size_t size); #endif -/* Compiler attributes */ - - -template -struct _hb_alignof -{ - struct s - { - char c; - T t; - }; - static constexpr size_t value = offsetof (s, t); -}; +/* + * Compiler attributes + * */ #if __cplusplus < 201103L @@ -122,6 +112,16 @@ struct _hb_alignof #define thread_local #endif +template +struct _hb_alignof +{ + struct s + { + char c; + T t; + }; + static constexpr size_t value = offsetof (s, t); +}; #ifndef alignof #define alignof(x) (_hb_alignof::value) #endif // alignof