Config_msc.h 2.75 KB
Newer Older
1
2
3
4
5
6
7
/******************************************************************************
 *
 * AMDiS - Adaptive multidimensional simulations
 *
 * Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
 * Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
 *
8
 * Authors:
9
10
11
12
13
14
15
16
17
 * 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.
18
 *
19
20
21
22
23
24
 ******************************************************************************/



/** \file Config_msc.h */

25
26
#pragma once

27
#define MSC_VERSION _MSC_VER
28
29
30
31
32
// MSC_VERSION == 1800 (Visual Studio 2013)
// MSC_VERSION == 1700 (Visual Studio 2012)
// MSC_VERSION == 1600 (Visual Studio 2010)
// MSC_VERSION == 1500 (Visual Studio 2008)

33
#define COMPILER_NAME "msc"
34
#define COMPILER_VERSION MSC_VERSION
35
#define COMPILER_IS_MSVC
36
37
38
39
40
41
42
43
44

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

45
46
47
48
#include <malloc.h>
#define ALIGNED_ALLOC(type,size,alignement) (type*)_aligned_malloc(size,alignement)
#define ALIGNED_FREE(ptr) _aligned_free(ptr);

49
50
51
52
53
54
// some compiler attributes
// ------------------------
#define NOINLINE         __declspec(noinline)
#define ALWAYS_INLINE    __forceinline
#define OPENMODE         std::ios::open_mode

55
56
57
58
59
#ifdef max
#undef max
#undef min
#endif

60
61
62
63
64
65
66
67
#ifdef NONE
#undef NONE
#endif

#ifdef THIS
#undef THIS
#endif

Praetorius, Simon's avatar
Praetorius, Simon committed
68
#if MSC_VERSION >= 1800 && !defined(HAS_VARIADIC_TEMPLATES)
69
70
71
  #define HAS_VARIADIC_TEMPLATES 1
#endif

Praetorius, Simon's avatar
Praetorius, Simon committed
72
#if MSC_VERSION >= 1800 && !defined(HAS_ALIAS_TEMPLATES)
73
74
75
  #define HAS_ALIAS_TEMPLATES 1
#endif

Praetorius, Simon's avatar
Praetorius, Simon committed
76
#if MSC_VERSION >= 1600 && !defined(HAS_DECLTYPE)
77
78
79
80
  #define HAS_DECLTYPE 1
#endif

// #if MSC_VERSION >= 2000 (?)
Praetorius, Simon's avatar
Praetorius, Simon committed
81
#if !defined(HAS_CONSTEXPR)
82
#define HAS_CONSTEXPR 0
Praetorius, Simon's avatar
Praetorius, Simon committed
83
#endif
84

Praetorius, Simon's avatar
Praetorius, Simon committed
85
#if MSC_VERSION >= 1800 && !defined(HAS_DELEGATING_CONSTRUCTORS)
86
87
88
  #define HAS_DELEGATING_CONSTRUCTORS 1
#endif

Praetorius, Simon's avatar
Praetorius, Simon committed
89
#if MSC_VERSION >= 1700 && !defined(HAS_RANGE_BASED_FOR)
90
91
92
  #define HAS_RANGE_BASED_FOR 1
#endif

Praetorius, Simon's avatar
Praetorius, Simon committed
93
#if MSC_VERSION >= 1800 && !defined(HAS_INITIALIZER_LISTS)
94
95
96
  #define HAS_INITIALIZER_LISTS 1
#endif

Praetorius, Simon's avatar
Praetorius, Simon committed
97
#if MSC_VERSION >= 1700 && !defined(HAS_OVERRIDE)
98
99
100
  #define HAS_OVERRIDE 1
#endif

Praetorius, Simon's avatar
Praetorius, Simon committed
101
#if MSC_VERSION >= 1700 && !defined(HAS_TYPED_ENUMS)
102
103
104
  #define HAS_TYPED_ENUMS 1
#endif

Praetorius, Simon's avatar
Praetorius, Simon committed
105
#if MSC_VERSION >= 1600 && !defined(HAS_RVALUE_REFERENCES)
106
107
108
  #define HAS_RVALUE_REFERENCES 1
#endif

109
// #endif