00001
00002
00003
00004
00005
00006
00007
00008 #ifndef SAGA_UTIL_HPP
00009 #define SAGA_UTIL_HPP
00010
00011 #include <utility>
00012 #include <saga/saga/base.hpp>
00013
00014 #include <boost/config.hpp>
00015
00016
00017
00018
00019
00020 #include <boost/cstdint.hpp>
00021
00022
00023
00024
00025 #if defined(SAGA_USE_TR1_NAMESPACE)
00026 #include <type_traits>
00027 #include <memory>
00028 #include <functional>
00029 #include <regex>
00030 #include <array>
00031 #define TR1 std::tr1 // define proper namespace
00032 #else
00033 #include <boost/ref.hpp>
00034 #include <boost/bind.hpp>
00035 #include <boost/shared_ptr.hpp>
00036 #include <boost/enable_shared_from_this.hpp>
00037 #include <boost/function.hpp>
00038 #include <boost/regex.hpp>
00039 #include <boost/array.hpp>
00040 #include <boost/type_traits/is_base_of.hpp>
00041 #include <boost/type_traits/is_reference.hpp>
00042 #include <boost/type_traits/remove_reference.hpp>
00043 #include <boost/type_traits/remove_pointer.hpp>
00044 #define TR1 boost // define proper namespace
00045 #endif
00046
00047 #include <saga/saga/export_definitions.hpp>
00048
00050
00051 #ifndef SAGA_ARGUMENT_LIMIT
00052 #define SAGA_ARGUMENT_LIMIT 6 // default argument count limit
00053 #endif
00054
00055
00056 #if defined(PHOENIX_LIMIT) && PHOENIX_LIMIT < 6
00057 # if defined(PHOENIX_TUPLES_HPP)
00058 # error "This file should be included before any of the Phoenix includes, or #define PHOENIX_LIMIT >= 6."
00059 # else
00060 # undef PHOENIX_LIMIT
00061 # endif
00062 #endif
00063
00064 #if !defined(PHOENIX_LIMIT)
00065 # define PHOENIX_LIMIT SAGA_ARGUMENT_LIMIT // tuple size limit
00066 #endif
00067
00069
00070 #ifdef BOOST_WINDOWS // windows
00071 # define SAGA_INI_PATH_DELIMITER ";"
00072 # define SAGA_SHARED_LIB_EXTENSION ".dll"
00073 # define SAGA_PATH_DELIMITERS "\\/"
00074 #else // unix like
00075 # define SAGA_INI_PATH_DELIMITER ":"
00076 # define SAGA_PATH_DELIMITERS "/"
00077 # ifdef SAGA_APPLE // apple
00078 # define SAGA_SHARED_LIB_EXTENSION ".dylib"
00079 # else // linux & co
00080 # define SAGA_SHARED_LIB_EXTENSION ".so"
00081 # endif
00082 #endif
00083
00085
00086 #if defined(BOOST_WINDOWS)
00087 #define snprintf _snprintf
00088 #endif
00089
00091
00092 #if defined(BUILD_SAGA_LITE)
00093 #define BOOST_PLUGIN_NO_EXPORT_API
00094 #endif
00095
00097
00098 #if !defined(BOOST_WINDOWS)
00099 # define SAGA_MANGLE_ADAPTOR_NAME(name) libsaga_adaptor_ ## name
00100 # define SAGA_MANGLE_ADAPTOR_NAME_STR(name) "libsaga_adaptor_" + name
00101 # define SAGA_MANGLE_PACKAGE_NAME(name) libsaga_package_ ## name
00102 # define SAGA_MANGLE_PACKAGE_NAME_STR(name) "libsaga_package_" + name
00103 #elif defined(_DEBUG)
00104 # define SAGA_MANGLE_ADAPTOR_NAME(name) name ## d
00105 # define SAGA_MANGLE_ADAPTOR_NAME_STR(name) name + "d"
00106 # define SAGA_MANGLE_PACKAGE_NAME(name) name ## d
00107 # define SAGA_MANGLE_PACKAGE_NAME_STR(name) name + "d"
00108 #else
00109 # define SAGA_MANGLE_ADAPTOR_NAME(name) name
00110 # define SAGA_MANGLE_ADAPTOR_NAME_STR(name) name
00111 # define SAGA_MANGLE_PACKAGE_NAME(name) name
00112 # define SAGA_MANGLE_PACKAGE_NAME_STR(name) name
00113 #endif
00114
00115 #endif // SAGA_UTIL_HPP
00116