ARB
gccver.h
Go to the documentation of this file.
1 // ================================================================ //
2 // //
3 // File : gccver.h //
4 // Purpose : central place for gcc-version-dependent defs //
5 // //
6 // Coded by Ralf Westram (coder@reallysoft.de) in December 2012 //
7 // Institute of Microbiology (Technical University Munich) //
8 // http://www.arb-home.de/ //
9 // //
10 // ================================================================ //
11 
12 #ifndef GCCVER_H
13 #define GCCVER_H
14 
15 #ifndef __GNUC__
16 # error You have to use the gnu compiler!
17 #endif
18 
19 #define GCC_VERSION_CODE ((__GNUC__ * 100) + __GNUC_MINOR__)
20 #define GCC_PATCHLEVEL_CODE ((GCC_VERSION_CODE * 100) + __GNUC_PATCHLEVEL__)
21 
22 // check required gcc version:
23 #if (GCC_PATCHLEVEL_CODE >= 40403) // gcc 4.4.3 or newer
24 # define GCC_VERSION_OK
25 #else
26 # if (GCC_VERSION_CODE >= 402) // gcc 4.2 is ok for clang
27 # ifdef __clang__
28 # define GCC_VERSION_OK
29 # endif
30 # endif
31 #endif
32 
33 #ifndef GCC_VERSION_OK
34 # error Wrong compiler version (need at least gcc 4.4.3 or clang 4.2)
35 #endif
36 
37 #else
38 #error gccver.h included twice
39 #endif // GCCVER_H