From f634a70117bf1fa4627c93864df104821fbfabae Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Tue, 25 Jul 2017 20:50:18 -0700 Subject: [PATCH] Move __CLANG_PREREQ to folly/CPortabiilty.h Summary: [Folly] Move `__CLANG_PREREQ` to `folly/CPortabiilty.h`. Reviewed By: Orvid Differential Revision: D5496372 fbshipit-source-id: 710af3d30aa8bd0e5f645beede354e3463f1bb25 --- folly/CPortability.h | 12 ++++++++++++ folly/Portability.h | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/folly/CPortability.h b/folly/CPortability.h index 1a47d251..ca5070a0 100644 --- a/folly/CPortability.h +++ b/folly/CPortability.h @@ -33,6 +33,18 @@ # endif #endif +// portable version check for clang +#ifndef __CLANG_PREREQ +# if defined __clang__ && defined __clang_major__ && defined __clang_minor__ +/* nolint */ +# define __CLANG_PREREQ(maj, min) \ + ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) +# else +/* nolint */ +# define __CLANG_PREREQ(maj, min) 0 +# endif +#endif + /* Define a convenience macro to test when address sanitizer is being used * across the different compilers (e.g. clang, gcc) */ #if defined(__clang__) diff --git a/folly/Portability.h b/folly/Portability.h index 04d1848d..423c9a2c 100644 --- a/folly/Portability.h +++ b/folly/Portability.h @@ -247,18 +247,6 @@ constexpr bool kIsSanitizeThread = false; #define FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS /* empty */ #endif -// portable version check for clang -#ifndef __CLANG_PREREQ -# if defined __clang__ && defined __clang_major__ && defined __clang_minor__ -/* nolint */ -# define __CLANG_PREREQ(maj, min) \ - ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) -# else -/* nolint */ -# define __CLANG_PREREQ(maj, min) 0 -# endif -#endif - /* Platform specific TLS support * gcc implements __thread * msvc implements __declspec(thread) -- 2.34.1