Escript  Revision_4320
escript/src/system_dep.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 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 since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15 
16 
21 /*
22  @(#) system_dep.h
23 */
24 
25 
26 #ifndef escript_system_dep_h
27 #define escript_system_dep_h
28 
29 
30 #ifdef NO_FLOAT_H
31 # define DBL_EPSILON 2.2204460492503131E-16
32 # define DBL_MAX 1.7976931348623157E+308
33 # define DBL_MIN 2.2250738585072014E-308
34 #else /* for the rest of the world */
35 # include <float.h>
36 #endif
37 #include <limits.h>
38 
39 #if defined(_WIN32) && defined(__INTEL_COMPILER)
40 /*
41  The Intel compiler on windows has an "improved" math library compared to the usual Visual C++ one
42  In particular it has a acosh and other similar functions which aren't implemented in Visual C++ math.h
43  Note you will get a compile time error if any other header (including system ones) includes math.h whilst mathimf.h
44  has been included. As a result system_dep.h must be included FIRST at all times (this prevents math.h from being included).
45 */
46 # include <mathimf.h>
47 # else
48 # include <math.h>
49 # endif
50 
51 #ifndef M_PI
52 # define M_PI 3.14159265358979323846
53 #endif
54 
55 #ifndef SQRT_DBL_EPSILON
56 # define SQRT_DBL_EPSILON 1.4901161193847656e-08
57 #endif
58 
59 #ifndef M_LN2
60 # define M_LN2 0.69314718055994530942 /* log_e 2 */
61 #endif
62 
63 #define ESCRIPT_DLL_API
64 
65 #ifdef _WIN32
66 # ifndef ESCRIPT_STATIC_LIB
67 # undef ESCRIPT_DLL_API
68 # ifdef ESCRIPT_EXPORTS
69 # define ESCRIPT_DLL_API __declspec(dllexport)
70 # else
71 # define ESCRIPT_DLL_API __declspec(dllimport)
72 # endif
73 # endif
74 #endif
75 
76 #ifndef ESCRIPT_MAX_DATA_RANK
77 #define ESCRIPT_MAX_DATA_RANK 4
78 #endif
79 
80 /* you'll need this one day. */
81 #ifndef __const
82 # if (defined __STDC__ && __STDC__) || defined __cplusplus
83 # define __const const
84 # else
85 # define __const
86 # endif
87 #endif
88 
89 #endif