Commit 408597e5 authored by Igor Sugak's avatar Igor Sugak Committed by facebook-github-bot-1

folly/portability: add clang version check

Summary: Define `__CLANG_PREREQ` macro to check version of clang.

Reviewed By: yfeldblum

Differential Revision: D2630325

fb-gh-sync-id: 3d666e554e8ddfc2c1fecd439aaf93f015829025
parent cb65a6b2
...@@ -174,6 +174,18 @@ ...@@ -174,6 +174,18 @@
namespace std { typedef ::max_align_t max_align_t; } namespace std { typedef ::max_align_t max_align_t; }
#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
/* Platform specific TLS support /* Platform specific TLS support
* gcc implements __thread * gcc implements __thread
* msvc implements __declspec(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