summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2018-11-22 00:16:53 -0500
committerBehdad Esfahbod <behdad@behdad.org>2018-11-22 00:16:53 -0500
commitad8826b18db5dec6fd220d63d717b1de8d48599c (patch)
tree74fd3daf3da6c7398bd646153ecc81f211f21d8f
parent8d778877b88155dec1808a994416ead0b3d98ae7 (diff)
downloadharfbuzz-decltype.tar.gz
Try using decltype, with fallback to typeof for C++<11decltype
See how bots react
-rw-r--r--src/hb-null.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/hb-null.hh b/src/hb-null.hh
index 51f653d2..8b36c05c 100644
--- a/src/hb-null.hh
+++ b/src/hb-null.hh
@@ -41,9 +41,14 @@
extern HB_INTERNAL
hb_vector_size_impl_t const _hb_NullPool[(HB_NULL_POOL_SIZE + sizeof (hb_vector_size_impl_t) - 1) / sizeof (hb_vector_size_impl_t)];
+#if __cplusplus < 201103L
+#define decltype typeof
+#endif
+
/* Generic nul-content Null objects. */
template <typename Type>
static inline Type const & Null (void) {
+ HB_UNUSED decltype (0) _i;
static_assert (sizeof (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE.");
return *reinterpret_cast<Type const *> (_hb_NullPool);
}