escript  Revision_
system_dep.h
Go to the documentation of this file.
00001 
00002 /*****************************************************************************
00003 *
00004 * Copyright (c) 2003-2014 by University of Queensland
00005 * http://www.uq.edu.au
00006 *
00007 * Primary Business: Queensland, Australia
00008 * Licensed under the Open Software License version 3.0
00009 * http://www.opensource.org/licenses/osl-3.0.php
00010 *
00011 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
00012 * Development 2012-2013 by School of Earth Sciences
00013 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
00014 *
00015 *****************************************************************************/
00016 
00017 
00022 /*
00023  @(#) system_dep.h
00024 */
00025 
00026 
00027 #ifndef escript_system_dep_h
00028 #define escript_system_dep_h
00029 
00030 
00031 #ifdef NO_FLOAT_H
00032 #   define DBL_EPSILON 2.2204460492503131E-16
00033 #   define DBL_MAX 1.7976931348623157E+308
00034 #   define DBL_MIN 2.2250738585072014E-308
00035 #else /* for the rest of the world */
00036 #   include <float.h>
00037 #endif
00038 #include <limits.h>
00039 
00040 #if defined(_WIN32) && defined(__INTEL_COMPILER)
00041 /*
00042  The Intel compiler on windows has an "improved" math library compared to the usual Visual C++ one
00043  In particular it has a acosh and other similar functions which aren't implemented in Visual C++ math.h
00044  Note you will get a compile time error if any other header (including system ones) includes math.h whilst mathimf.h
00045  has been included. As a result system_dep.h must be included FIRST at all times (this prevents math.h from being included).
00046 */
00047 #  include <mathimf.h>
00048 # else
00049 #  include <cmath>
00050 # endif
00051 
00052 #ifndef M_PI
00053 #   define M_PI 3.14159265358979323846
00054 #endif
00055 
00056 #ifndef SQRT_DBL_EPSILON
00057 #   define SQRT_DBL_EPSILON   1.4901161193847656e-08
00058 #endif
00059 
00060 #ifndef M_LN2
00061 #   define M_LN2  0.69314718055994530942  /* log_e 2 */
00062 #endif
00063 
00064 #define ESCRIPT_DLL_API
00065 
00066 #ifdef _WIN32
00067 #   ifndef ESCRIPT_STATIC_LIB
00068 #      undef ESCRIPT_DLL_API
00069 #      ifdef ESCRIPT_EXPORTS
00070 #         define ESCRIPT_DLL_API __declspec(dllexport)
00071 #      else
00072 #         define ESCRIPT_DLL_API __declspec(dllimport)
00073 #      endif
00074 #   endif
00075 #endif
00076 
00077 #ifndef ESCRIPT_MAX_DATA_RANK
00078 #define ESCRIPT_MAX_DATA_RANK 4
00079 #endif
00080 
00081 /* you'll need this one day. */
00082 #ifndef __const
00083 # if (defined __STDC__ && __STDC__) || defined __cplusplus
00084 #  define __const   const
00085 # else
00086 #  define __const
00087 # endif
00088 #endif
00089 
00090 #endif