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 #include <type_traits>
00028 #include <memory>
00029 #include <functional>
00030 #include <regex>
00031 #include <array>
00032 #define TR1 std::tr1 // define proper namespace
00033 #else
00034 #include <boost/ref.hpp>
00035 #include <boost/bind.hpp>
00036 #include <boost/shared_ptr.hpp>
00037 #include <boost/weak_ptr.hpp>
00038 #include <boost/enable_shared_from_this.hpp>
00039 #include <boost/function.hpp>
00040 #include <boost/regex.hpp>
00041 #include <boost/array.hpp>
00042 #include <boost/type_traits/is_base_of.hpp>
00043 #include <boost/type_traits/is_reference.hpp>
00044 #include <boost/type_traits/remove_reference.hpp>
00045 #include <boost/type_traits/remove_pointer.hpp>
00046 #define TR1 boost // define proper namespace
00047 #endif
00048
00049 #include <saga/saga/export_definitions.hpp>
00050
00052
00053 #ifndef SAGA_ARGUMENT_LIMIT
00054 #define SAGA_ARGUMENT_LIMIT 6 // default argument count limit
00055 #endif
00056
00057
00058 #if defined(PHOENIX_LIMIT) && PHOENIX_LIMIT < 6
00059 # if defined(PHOENIX_TUPLES_HPP)
00060 # error "This file should be included before any of the Phoenix includes, or #define PHOENIX_LIMIT >= 6."
00061 # else
00062 # undef PHOENIX_LIMIT
00063 # endif
00064 #endif
00065
00066 #if !defined(PHOENIX_LIMIT)
00067 # define PHOENIX_LIMIT SAGA_ARGUMENT_LIMIT // tuple size limit
00068 #endif
00069
00071
00072 #ifdef BOOST_WINDOWS // windows
00073 # define SAGA_INI_PATH_DELIMITER ";"
00074 # define SAGA_SHARED_LIB_EXTENSION ".dll"
00075 # define SAGA_PATH_DELIMITERS "\\/"
00076 #else // unix like
00077 # define SAGA_INI_PATH_DELIMITER ":"
00078 # define SAGA_PATH_DELIMITERS "/"
00079 # ifdef SAGA_APPLE // apple
00080 # define SAGA_SHARED_LIB_EXTENSION ".dylib"
00081 # else // linux & co
00082 # define SAGA_SHARED_LIB_EXTENSION ".so"
00083 # endif
00084 #endif
00085
00087
00088 #if defined(BOOST_WINDOWS)
00089 #define snprintf _snprintf
00090 #endif
00091
00093
00094 #if defined(BUILD_SAGA_LITE)
00095 #define BOOST_PLUGIN_NO_EXPORT_API
00096 #endif
00097
00099
00100 #if !defined(BOOST_WINDOWS)
00101 # define SAGA_MANGLE_ADAPTOR_NAME(name) libsaga_adaptor_ ## name
00102 # define SAGA_MANGLE_ADAPTOR_NAME_STR(name) "libsaga_adaptor_" + name
00103 # define SAGA_MANGLE_PACKAGE_NAME(name) libsaga_package_ ## name
00104 # define SAGA_MANGLE_PACKAGE_NAME_STR(name) "libsaga_package_" + name
00105 #elif defined(_DEBUG)
00106 # define SAGA_MANGLE_ADAPTOR_NAME(name) name ## d
00107 # define SAGA_MANGLE_ADAPTOR_NAME_STR(name) name + "d"
00108 # define SAGA_MANGLE_PACKAGE_NAME(name) name ## d
00109 # define SAGA_MANGLE_PACKAGE_NAME_STR(name) name + "d"
00110 #else
00111 # define SAGA_MANGLE_ADAPTOR_NAME(name) name
00112 # define SAGA_MANGLE_ADAPTOR_NAME_STR(name) name
00113 # define SAGA_MANGLE_PACKAGE_NAME(name) name
00114 # define SAGA_MANGLE_PACKAGE_NAME_STR(name) name
00115 #endif
00116
00118
00119
00120 #if defined(SAGA_USE_EXCEPTION_SPECIFICATIONS)
00121 #define SAGA_THROW_SPEC(x) x
00122 #else
00123 #define SAGA_THROW_SPEC(x)
00124 #endif
00125
00126 #endif // SAGA_UTIL_HPP
00127