Config_gcc.h 2.14 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/******************************************************************************
 *
 * AMDiS - Adaptive multidimensional simulations
 *
 * Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
 * Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
 *
 * Authors: 
 * Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 *
 * This file is part of AMDiS
 *
 * See also license.opensource.txt in the distribution.
 * 
 ******************************************************************************/



/** \file Config_gcc.h */

25
26
27
28
#pragma once

#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)

29
#define COMPILER_NAME "gcc"
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#define COMPILER_VERSION GCC_VERSION

// alignement specification
// ------------------------
#define ALIGNED(type,name,N)  type name[N] __attribute__ ((aligned(CACHE_LINE)))
typedef double aligned_double   __attribute__ ((aligned(CACHE_LINE)));
typedef float  aligned_float    __attribute__ ((aligned(CACHE_LINE)));
typedef int    aligned_int      __attribute__ ((aligned(CACHE_LINE)));
typedef size_t aligned_size_t   __attribute__ ((aligned(CACHE_LINE)));

// some compiler attributes
// ------------------------
#define NOINLINE                __attribute__ ((noinline))
#define ALWAYS_INLINE           __attribute__ ((always_inline))
#define OPENMODE                std::ios::openmode

// C++11 features
// --------------
#if __cplusplus > 199711L

#if GCC_VERSION >= 40300
  #define HAS_VARIADIC_TEMPLATES 1
#endif

#if GCC_VERSION >= 40700
  #define HAS_ALIAS_TEMPLATES 1
#endif

58
#if GCC_VERSION >= 40300
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
  #define HAS_DECLTYPE 1
#endif

#if GCC_VERSION >= 40600
  #define HAS_CONSTEXPR 1
#endif

#if GCC_VERSION >= 40700
  #define HAS_DELEGATING_CONSTRUCTORS 1
#endif

#if GCC_VERSION >= 40600
  #define HAS_RANGE_BASED_FOR 1
#endif

#if GCC_VERSION >= 40400
  #define HAS_INITIALIZER_LISTS 1
#endif

#if GCC_VERSION >= 40700
  #define HAS_OVERRIDE 1
#endif

#if GCC_VERSION >= 40400
  #define HAS_TYPED_ENUMS 1
#endif

86
#endif