-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a CLANG_PREREQUISITE macro
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef FWCore_Utilities_interface_ClangPrerequisite_h | ||
#define FWCore_Utilities_interface_ClangPrerequisite_h | ||
|
||
/* Convenience macro to test the version of clang. | ||
Use it like this: | ||
#if CLANG_PREREQUISITE(9,0,1) | ||
... code requiring clang 9.0.1 or later ... | ||
#endif | ||
*/ | ||
|
||
#if defined __clang__ && defined __clang_major__ && defined __clang_minor__ && defined __clang_patchlevel__ | ||
#define CLANG_PREREQUISITE(maj, min, patch) \ | ||
((__clang_major__ << 16) + (__clang_minor__ << 8) + __clang_patchlevel__ >= ((maj) << 16) + ((min) << 8) + (patch)) | ||
#else | ||
#define CLANG_PREREQUISITE(maj, min, patch) 0 | ||
#endif | ||
|
||
#endif // FWCore_Utilities_interface_ClangPrerequisite_h |