Config_defaults.h 2.4 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_defaults.h */

25 26 27 28 29 30 31 32 33 34 35 36 37
#pragma once

#ifndef COMPILER_NAME
  #define COMPILER_NAME "Unknown"
#endif
#ifndef COMPILER_VERSION
  #define COMPILER_VERSION 0
#endif

// alignement specification
// ------------------------
#ifndef ALIGNED
#define ALIGNED(type,name,N)  type name[N]
38 39
#define ASSUME_ALIGNED(var)   var

40 41 42 43
typedef double aligned_double;
typedef float  aligned_float;
typedef int    aligned_int;
typedef size_t aligned_size_t;
44 45 46 47 48 49
#endif

#ifndef ALIGNED_ALLOC
  // define aligned_malloc and aligned_free somewhere else, before using the macros
  #define ALIGNED_ALLOC(type,size,alignment) (type*)aligned_malloc(size*sizeof(type), alignment)
  #define ALIGNED_FREE(ptr) aligned_free(ptr)
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
#endif

// some compiler attributes
// ------------------------
#ifndef NOINLINE
  #define NOINLINE
#endif
#ifndef ALWAYS_INLINE
  #define ALWAYS_INLINE
#endif
#ifndef OPENMODE
  #define OPENMODE std::ios::openmode
#endif

// C++11 features
// --------------
66 67
#ifndef AMDIS_HAS_CXX11
  #define AMDIS_HAS_CXX11 0
Praetorius, Simon's avatar
Praetorius, Simon committed
68 69
#endif

70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
#ifndef HAS_VARIADIC_TEMPLATES
  #define HAS_VARIADIC_TEMPLATES 0
#endif

#ifndef HAS_ALIAS_TEMPLATES
  #define HAS_ALIAS_TEMPLATES 0
#endif

#ifndef HAS_DECLTYPE
  #define HAS_DECLTYPE 0
#endif

#ifndef HAS_CONSTEXPR
  #define HAS_CONSTEXPR 0
#endif

#ifndef HAS_DELEGATING_CONSTRUCTORS
  #define HAS_DELEGATING_CONSTRUCTORS 0
#endif

#ifndef HAS_RANGE_BASED_FOR
  #define HAS_RANGE_BASED_FOR 0
#endif

#ifndef HAS_INITIALIZER_LISTS
  #define HAS_INITIALIZER_LISTS 0
#endif

#ifndef HAS_OVERRIDE
  #define HAS_OVERRIDE 0
  #define override
#endif

#ifndef HAS_TYPED_ENUMS
  #define HAS_TYPED_ENUMS 0
105
#endif
106 107 108 109 110 111 112 113

#ifndef HAS_RVALUE_REFERENCES
  #define HAS_RVALUE_REFERENCES 0
#endif

// #ifdef BOOST_NO_CXX11_NOEXCEPT
//   #define noexcept
// #endif