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