/[escript]/trunk/escript/src/system_dep.h
ViewVC logotype

Annotation of /trunk/escript/src/system_dep.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2018 - (hide annotations)
Mon Nov 10 13:31:43 2008 UTC (11 years ago) by phornby
File MIME type: text/plain
File size: 1997 byte(s)
Only import mathimf.h on win32 with intelc. Allow others to use the
standard math.h

change the #ifndef const -> #ifndef __const (oops!!)


1 ksteube 1312
2     /*******************************************************
3 ksteube 1811 *
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 ksteube 1312
14 ksteube 1811
15 phornby 1031 /**
16     \file system_dep.h
17     \ingroup Other
18     */
19 gross 1034 /*
20     @(#) system_dep.h
21     */
22 phornby 1031
23 gross 1034
24 phornby 1031 #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 phornby 2018 #if defined(_WIN32) && defined(__INTEL_COMPILER)
38 gross 1034 /*
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 phornby 1031 # 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     #ifdef _WIN32
62    
63 phornby 1628 # ifndef INTERFACE_STATIC_LIB
64     # ifdef ESCRIPT_EXPORTS
65     # define ESCRIPT_DLL_API __declspec(dllexport)
66     # else
67     # define ESCRIPT_DLL_API __declspec(dllimport)
68     # endif
69     # endif
70 phornby 1031
71     #else
72 phornby 1628 # define ESCRIPT_DLL_API
73 phornby 1031 #endif
74    
75 phornby 1634 /* you'll need this one day. */
76 phornby 2018 #ifndef __const
77 phornby 1634 # if (defined __STDC__ && __STDC__) || defined __cplusplus
78     # define __const const
79     # else
80     # define __const
81     # endif
82 phornby 1031 #endif
83 phornby 1634
84     #endif

  ViewVC Help
Powered by ViewVC 1.1.26