escript  Revision_4925
escriptcore/src/system_dep.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 
22 /*
23  @(#) system_dep.h
24 */
25 
26 
27 #ifndef escript_system_dep_h
28 #define escript_system_dep_h
29 
30 
31 #ifdef NO_FLOAT_H
32 # define DBL_EPSILON 2.2204460492503131E-16
33 # define DBL_MAX 1.7976931348623157E+308
34 # define DBL_MIN 2.2250738585072014E-308
35 #else /* for the rest of the world */
36 # include <float.h>
37 #endif
38 #include <limits.h>
39 
40 #if defined(_WIN32) && defined(__INTEL_COMPILER)
41 /*
42  The Intel compiler on windows has an "improved" math library compared to the usual Visual C++ one
43  In particular it has a acosh and other similar functions which aren't implemented in Visual C++ math.h
44  Note you will get a compile time error if any other header (including system ones) includes math.h whilst mathimf.h
45  has been included. As a result system_dep.h must be included FIRST at all times (this prevents math.h from being included).
46 */
47 # include <mathimf.h>
48 # else
49 # include <cmath>
50 # endif
51 
52 #ifndef M_PI
53 # define M_PI 3.14159265358979323846
54 #endif
55 
56 #ifndef SQRT_DBL_EPSILON
57 # define SQRT_DBL_EPSILON 1.4901161193847656e-08
58 #endif
59 
60 #ifndef M_LN2
61 # define M_LN2 0.69314718055994530942 /* log_e 2 */
62 #endif
63 
64 #define ESCRIPT_DLL_API
65 
66 #ifdef _WIN32
67 # ifndef ESCRIPT_STATIC_LIB
68 # undef ESCRIPT_DLL_API
69 # ifdef ESCRIPT_EXPORTS
70 # define ESCRIPT_DLL_API __declspec(dllexport)
71 # else
72 # define ESCRIPT_DLL_API __declspec(dllimport)
73 # endif
74 # endif
75 #endif
76 
77 #ifndef ESCRIPT_MAX_DATA_RANK
78 #define ESCRIPT_MAX_DATA_RANK 4
79 #endif
80 
81 /* you'll need this one day. */
82 #ifndef __const
83 # if (defined __STDC__ && __STDC__) || defined __cplusplus
84 # define __const const
85 # else
86 # define __const
87 # endif
88 #endif
89 
90 #endif