Lunchbox  1.8.0
compiler.h
1 
2 /* Copyright (c) 2010-2012, Stefan Eilemann <eile@eyescale.ch>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef LUNCHBOX_COMPILER_H
19 #define LUNCHBOX_COMPILER_H
20 
21 #ifdef _MSC_VER
22 
23 # define LB_ALIGN8( var ) __declspec (align (8)) var;
24 
25 # define LB_ALIGN16( var ) __declspec (align (16)) var;
26 #else
27 
28 # define LB_ALIGN8( var ) var __attribute__ ((aligned (8)));
29 
30 # define LB_ALIGN16( var ) var __attribute__ ((aligned (16)));
31 #endif
32 
33 #ifdef __GNUC__
34 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 0)) )
35 # define LB_GCC_4_0_OR_LATER
36 # endif
37 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 1)) )
38 # define LB_GCC_4_1_OR_LATER
39 # endif
40 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2)) )
41 # define LB_GCC_4_2_OR_LATER
42 # endif
43 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)) )
44 # define LB_GCC_4_3_OR_LATER
45 # endif
46 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) )
47 # define LB_GCC_4_4_OR_LATER
48 # endif
49 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) )
50 # define LB_GCC_4_5_OR_LATER
51 # endif
52 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) )
53 # define LB_GCC_4_6_OR_LATER
54 # endif
55 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)) )
56 # define LB_GCC_4_7_OR_LATER
57 # endif
58 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)) )
59 # define LB_GCC_4_8_OR_LATER
60 # endif
61 # if (( __GNUC__ > 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) )
62 # define LB_GCC_4_9_OR_LATER
63 # endif
64 
65 # if (( __GNUC__ < 4 ) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 3)) )
66 # define LB_GCC_4_3_OR_OLDER
67 # endif
68 #endif // GCC
69 
70 #endif //LUNCHBOX_COMPILER_H