CMS 3D CMS Logo

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) ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
16 #else
17 #define GCC_PREREQUISITE(maj, min, patch) 0
18 #endif
19 
20 #endif