From f64ea8fc65b0dacc2ac3b1de97c92488b6e1b6fa Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 30 Dec 2018 18:49:34 -0500 Subject: [PATCH] [meta] Move code around --- src/hb-atomic.hh | 1 + src/hb-meta.hh | 10 ++++++++++ src/hb.hh | 14 +------------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh index 9321932e0..165c7aa16 100644 --- a/src/hb-atomic.hh +++ b/src/hb-atomic.hh @@ -33,6 +33,7 @@ #define HB_ATOMIC_HH #include "hb.hh" +#include "hb-meta.hh" /* diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 6646d284e..feaaa0850 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -37,6 +37,16 @@ template static inline T hb_declval (); +template struct hb_remove_const { typedef T value; }; +template struct hb_remove_const { typedef T value; }; +#define hb_remove_const(T) hb_remove_const::value +template struct hb_remove_reference { typedef T value; }; +template struct hb_remove_reference { typedef T value; }; +#define hb_remove_reference(T) hb_remove_reference::value +template struct hb_remove_pointer { typedef T value; }; +template struct hb_remove_pointer { typedef T value; }; +#define hb_remove_pointer(T) hb_remove_pointer::value + /* Void! For when we need a expression-type of void. */ struct hb_void_t { typedef void value; }; diff --git a/src/hb.hh b/src/hb.hh index 503f24ffe..3e75adb04 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -612,24 +612,12 @@ _hb_memalign(void **memptr, size_t alignment, size_t size) #define HB_SCRIPT_MYANMAR_ZAWGYI ((hb_script_t) HB_TAG ('Q','a','a','g')) -/* Some really basic things everyone wants. */ -template struct hb_remove_const { typedef T value; }; -template struct hb_remove_const { typedef T value; }; -#define hb_remove_const(T) hb_remove_const::value -template struct hb_remove_reference { typedef T value; }; -template struct hb_remove_reference { typedef T value; }; -#define hb_remove_reference(T) hb_remove_reference::value -template struct hb_remove_pointer { typedef T value; }; -template struct hb_remove_pointer { typedef T value; }; -#define hb_remove_pointer(T) hb_remove_pointer::value - - /* Headers we include for everyone. Keep topologically sorted by dependency. * They express dependency amongst themselves, but no other file should include * them directly.*/ -#include "hb-atomic.hh" #include "hb-meta.hh" #include "hb-mutex.hh" +#include "hb-atomic.hh" // Requires: hb-meta #include "hb-null.hh" // Requires: hb-meta #include "hb-dsalgs.hh" // Requires: hb-null #include "hb-iter.hh" // Requires: hb-dsalgs hb-meta hb-null