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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1634 - (show annotations)
Sat Jul 12 09:08:33 2008 UTC (11 years, 2 months ago) by phornby
File MIME type: text/plain
File size: 2006 byte(s)
linux_gcc_eg_options.py:
remove the std99 option, it is no longer needed as the code compiles without
C 1999 extension (need for these extensions elinminated in windows port).
Turn on all warnings except unknown pragmas. Should catch a lot of stuff.

SConstruct:
Impassioned plea

system_dep.h:
Add the standard incantation for dealing with const declarations
in C code called from C and C++

blocktimer:
Get the calling interface right for C code called from C and C++
and use __const as defined in system_dep.h
(Should be re-factored into compiler_dep.h file).

MeshAdapterFactory.cpp:
Since we have (effectively) no control over netCDF policy,
cast const char *'s to char *'s


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

  ViewVC Help
Powered by ViewVC 1.1.26