Skip to content

Commit

Permalink
Move __CLANG_PREREQ to folly/CPortabiilty.h
Browse files Browse the repository at this point in the history
Summary: [Folly] Move `__CLANG_PREREQ` to `folly/CPortabiilty.h`.

Reviewed By: Orvid

Differential Revision: D5496372

fbshipit-source-id: 710af3d30aa8bd0e5f645beede354e3463f1bb25
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Jul 26, 2017
1 parent 20408f9 commit f634a70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 12 additions & 0 deletions folly/CPortability.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down
12 changes: 0 additions & 12 deletions folly/Portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f634a70

Please sign in to comment.