test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GCCPrerequisite.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_GCCPrerequisite_h
2 #define FWCore_Utilities_GCCPrerequisite_h
3 
4 /* Convenience macro to test the version of gcc.
5  Use it like this:
6  #if GCC_PREREQUISITE(3,4,4)
7  ... code requiring gcc 3.4.4 or later ...
8  #endif
9  Note - it won't work for gcc1 since the _MINOR macros
10  were not defined then. */
11 #if defined __GNUC__ && defined __GNUC_MINOR__ && defined __GNUC_PATCHLEVEL__
12 # define GCC_PREREQUISITE(maj, min, patch) \
13  ((__GNUC__ << 16) + (__GNUC_MINOR__ << 8) + __GNUC_PATCHLEVEL__ >= ((maj) << 16) + ((min) << 8) + (patch))
14 #elif defined __GNUC__ && defined __GNUC_MINOR__
15 # define GCC_PREREQUISITE(maj, min, patch) \
16  ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
17 #else
18 # define GCC_PREREQUISITE(maj, min, patch) 0
19 #endif
20 
21 #endif