00001
00002
00003
00004
00005
00006
00007
00008 #ifndef SAGA_UTIL_HPP
00009 #define SAGA_UTIL_HPP
00010
00011 #include <utility>
00012 #include <climits>
00013 #include <saga/saga/base.hpp>
00014
00015 #include <boost/config.hpp>
00016
00017
00018
00019
00020
00021 #include <boost/cstdint.hpp>
00022
00023
00024
00025
00026 #if defined(SAGA_USE_TR1_NAMESPACE)
00027
00028 #if defined(SAGA_PRINT_USED_NAMESPACE)
00029 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
00030 #pragma message("Note: using namespace std::tr1")
00031 #elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
00032 #warning "using namespace std::tr1"
00033 #endif
00034 #endif
00035
00036 #include <type_traits>
00037 #include <memory>
00038 #include <functional>
00039 #include <regex>
00040 #include <array>
00041 #define TR1 std::tr1 // define proper namespace
00042 #else
00043
00044 #if defined(SAGA_PRINT_USED_NAMESPACE)
00045 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__)
00046 #pragma message("Note: using namespace boost")
00047 #elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
00048 #warning "using namespace boost"
00049 #endif
00050 #endif
00051
00052 #include <boost/ref.hpp>
00053 #include <boost/bind.hpp>
00054 #include <boost/shared_ptr.hpp>
00055 #include <boost/weak_ptr.hpp>
00056 #include <boost/enable_shared_from_this.hpp>
00057 #include <boost/function.hpp>
00058 #include <boost/regex.hpp>
00059 #include <boost/array.hpp>
00060 #include <boost/type_traits/is_base_of.hpp>
00061 #include <boost/type_traits/is_reference.hpp>
00062 #include <boost/type_traits/remove_reference.hpp>
00063 #include <boost/type_traits/remove_pointer.hpp>
00064 #define TR1 boost // define proper namespace
00065
00066
00067 namespace boost { namespace placeholders
00068 {
00069 using ::_1;
00070 using ::_2;
00071 using ::_3;
00072 using ::_4;
00073 using ::_5;
00074 using ::_6;
00075 using ::_7;
00076 using ::_8;
00077 using ::_9;
00078 }}
00079 #endif
00080
00081 #include <saga/saga/export_definitions.hpp>
00082
00084
00085 #ifndef SAGA_ARGUMENT_LIMIT
00086 #define SAGA_ARGUMENT_LIMIT 6 // default argument count limit
00087 #endif
00088
00089
00090 #if defined(PHOENIX_LIMIT) && PHOENIX_LIMIT < 6
00091 # if defined(PHOENIX_TUPLES_HPP)
00092 # error "This file should be included before any of the Phoenix includes, or #define PHOENIX_LIMIT >= 6."
00093 # else
00094 # undef PHOENIX_LIMIT
00095 # endif
00096 #endif
00097
00098 #if !defined(PHOENIX_LIMIT)
00099 # define PHOENIX_LIMIT SAGA_ARGUMENT_LIMIT // tuple size limit
00100 #endif
00101
00103
00104 #ifdef BOOST_WINDOWS // windows
00105 # define SAGA_INI_PATH_DELIMITER ";"
00106 # define SAGA_SHARED_LIB_EXTENSION ".dll"
00107 # define SAGA_PATH_DELIMITERS "\\/"
00108 #else // unix like
00109 # define SAGA_INI_PATH_DELIMITER ":"
00110 # define SAGA_PATH_DELIMITERS "/"
00111 # ifdef SAGA_APPLE // apple
00112 # define SAGA_SHARED_LIB_EXTENSION ".dylib"
00113 # else // linux & co
00114 # define SAGA_SHARED_LIB_EXTENSION ".so"
00115 # endif
00116 #endif
00117
00119
00120 #if defined(BOOST_WINDOWS)
00121 #define snprintf _snprintf
00122 #endif
00123
00125
00126 #if defined(BUILD_SAGA_LITE)
00127 #define BOOST_PLUGIN_NO_EXPORT_API
00128 #endif
00129
00131
00132 #if !defined(BOOST_WINDOWS)
00133 # define SAGA_MANGLE_ADAPTOR_NAME(name) BOOST_PP_CAT(libsaga_adaptor_, name)
00134 # define SAGA_MANGLE_ADAPTOR_NAME_STR(name) "libsaga_adaptor_" + name
00135 # define SAGA_MANGLE_PACKAGE_NAME(name) BOOST_PP_CAT(libsaga_package_, name)
00136 # define SAGA_MANGLE_PACKAGE_NAME_STR(name) "libsaga_package_" + name
00137 # define SAGA_MANGLE_ENGINE_NAME(name) BOOST_PP_CAT(libsaga_, name)
00138 # define SAGA_MANGLE_ENGINE_NAME_STR(name) "libsaga_" + name
00139 #elif defined(_DEBUG)
00140 # define SAGA_MANGLE_ADAPTOR_NAME(name) BOOST_PP_CAT(name, d)
00141 # define SAGA_MANGLE_ADAPTOR_NAME_STR(name) name + "d"
00142 # define SAGA_MANGLE_PACKAGE_NAME(name) BOOST_PP_CAT(name, d)
00143 # define SAGA_MANGLE_PACKAGE_NAME_STR(name) name + "d"
00144 # define SAGA_MANGLE_ENGINE_NAME(name) BOOST_PP_CAT(saga_, BOOST_PP_CAT(name, d))
00145 # define SAGA_MANGLE_ENGINE_NAME_STR(name) "saga_" + name + "d"
00146 #else
00147 # define SAGA_MANGLE_ADAPTOR_NAME(name) name
00148 # define SAGA_MANGLE_ADAPTOR_NAME_STR(name) name
00149 # define SAGA_MANGLE_PACKAGE_NAME(name) name
00150 # define SAGA_MANGLE_PACKAGE_NAME_STR(name) name
00151 # define SAGA_MANGLE_ENGINE_NAME(name) BOOST_PP_CAT(saga_, name)
00152 # define SAGA_MANGLE_ENGINE_NAME_STR(name) "saga_" + name
00153 #endif
00154
00156
00157
00158 #if defined(SAGA_USE_EXCEPTION_SPECIFICATIONS)
00159 #define SAGA_THROW_SPEC(x) x
00160 #else
00161 #define SAGA_THROW_SPEC(x)
00162 #endif
00163
00164 #endif // SAGA_UTIL_HPP
00165