Commit f634a701 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

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
parent 20408f9a
......@@ -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__)
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment