Define GCC_VERSION in util.h temporarily.
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
This commit is contained in:
parent
5e7f754214
commit
2816f206fb
|
@ -56,11 +56,19 @@ extern "C" {
|
||||||
# define PIC_GENSYM(x) PIC_GENSYM1_(__LINE__,x)
|
# define PIC_GENSYM(x) PIC_GENSYM1_(__LINE__,x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if __GNUC__
|
||||||
|
# define GCC_VERSION (__GNUC__ * 10000 \
|
||||||
|
+ __GNUC_MINOR__ * 100 \
|
||||||
|
+ __GNUC_PATCHLEVEL__)
|
||||||
|
#endif
|
||||||
#if GCC_VERSION >= 40500 || __clang__
|
#if GCC_VERSION >= 40500 || __clang__
|
||||||
# define PIC_UNREACHABLE() (__builtin_unreachable())
|
# define PIC_UNREACHABLE() (__builtin_unreachable())
|
||||||
#else
|
#else
|
||||||
# define PIC_UNREACHABLE() (assert(false))
|
# define PIC_UNREACHABLE() (assert(false))
|
||||||
#endif
|
#endif
|
||||||
|
#if __GNUC__
|
||||||
|
# undef GCC_VERSION
|
||||||
|
#endif
|
||||||
|
|
||||||
#define PIC_SWAP(type,a,b) \
|
#define PIC_SWAP(type,a,b) \
|
||||||
PIC_SWAP_HELPER_(type, PIC_GENSYM(tmp), a, b)
|
PIC_SWAP_HELPER_(type, PIC_GENSYM(tmp), a, b)
|
||||||
|
|
Loading…
Reference in New Issue