26#ifndef quantlib_defines_hpp
28#define quantlib_defines_hpp
35#define _USE_MATH_DEFINES
38#include <boost/config.hpp>
39#include <boost/version.hpp>
40#if BOOST_VERSION < 104800
41 #error using an old version of Boost, please update.
43#if !defined(BOOST_ENABLE_ASSERT_HANDLER)
44 #define BOOST_ENABLE_ASSERT_HANDLER
53#define INCLUDE_FILE(F) INCLUDE_FILE_(F)
54#define INCLUDE_FILE_(F) #F
55#ifdef QL_INCLUDE_FIRST
56# include INCLUDE_FILE(QL_INCLUDE_FIRST)
66# define QL_INTEGER int
70# define QL_BIG_INTEGER long
74# define QL_REAL double
86#if (defined(_DEBUG) || defined(DEBUG))
90#if defined(HAVE_CONFIG_H)
91 #include <ql/config.hpp>
95#elif defined(BOOST_MSVC)
96 #include <ql/config.msvc.hpp>
97#elif defined(__MINGW32__)
99#elif defined(__SUNPRO_CC)
108 #ifndef QL_EXTRA_SAFETY_CHECKS
109 #define QL_EXTRA_SAFETY_CHECKS
113#ifdef QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
114 #if BOOST_VERSION < 105800
115 #error Boost version 1.58 or higher is required for the thread-safe observer pattern
119#ifdef QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER
120 #if BOOST_VERSION < 105900
121 #error Boost version 1.59 or higher is required for the parallel unit test runner
130#if defined(BOOST_NO_STDC_NAMESPACE)
133 using ::sqrt; using ::abs; using ::fabs;
134 using ::exp; using ::log; using ::pow;
135 using ::sin; using ::cos; using ::asin; using ::acos;
136 using ::sinh; using ::cosh;
137 using ::floor; using ::fmod; using ::modf;
173#define QL_MIN_INTEGER ((std::numeric_limits<QL_INTEGER>::min)())
174#define QL_MAX_INTEGER ((std::numeric_limits<QL_INTEGER>::max)())
175#define QL_MIN_REAL -((std::numeric_limits<QL_REAL>::max)())
176#define QL_MAX_REAL ((std::numeric_limits<QL_REAL>::max)())
177#define QL_MIN_POSITIVE_REAL ((std::numeric_limits<QL_REAL>::min)())
178#define QL_EPSILON ((std::numeric_limits<QL_REAL>::epsilon)())
192#if defined(BOOST_MSVC)
193# define QL_DEPRECATED __declspec(deprecated)
194# define QL_DEPRECATED_DISABLE_WARNING \
195 __pragma(warning(push)) \
196 __pragma(warning(disable : 4996))
197# define QL_DEPRECATED_ENABLE_WARNING \
198 __pragma(warning(pop))
199#elif defined(__GNUC__)
200# define QL_DEPRECATED __attribute__((deprecated))
201# define QL_DEPRECATED_DISABLE_WARNING \
202 _Pragma("GCC diagnostic push") \
203 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
204# define QL_DEPRECATED_ENABLE_WARNING \
205 _Pragma("GCC diagnostic pop")
206#elif defined(__clang__)
207# define QL_DEPRECATED __attribute__((deprecated))
208# define QL_DEPRECATED_DISABLE_WARNING \
209 _Pragma("clang diagnostic push") \
210 _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
211# define QL_DEPRECATED_ENABLE_WARNING \
212 _Pragma("clang diagnostic pop")
215# define QL_DEPRECATED
216# define QL_DEPRECATED_DISABLE_WARNING
217# define QL_DEPRECATED_ENABLE_WARNING