00001 #ifndef CLASSLIB_SYSTEM_H
00002 # define CLASSLIB_SYSTEM_H
00003
00004 # include "classlib/sysapi/config.h"
00005 # include <sys/types.h>
00006
00027 # ifndef CLASSLIB_API
00028 # ifdef _WIN32
00029 # if defined CLASSLIB_BUILD_DLL
00030 # define CLASSLIB_API __declspec(dllexport)
00031 # elif ! defined CLASSLIB_BUILD_ARCHIVE
00032 # define CLASSLIB_API __declspec(dllimport)
00033 # endif
00034 # endif
00035 # endif
00036
00037 # ifndef CLASSLIB_API
00038 # define CLASSLIB_API
00039 # endif
00040
00041
00042
00043
00044
00045 # if HAVE_SOCKADDR_UN
00046 # define HAVE_LOCAL_SOCKETS 1
00047 # endif
00048
00049 # if HAVE_U_STACK_TRACE \
00050 || HAVE_BACKTRACE_SYMBOLS_FD \
00051 || (HAVE_EXCPT_H && HAVE_RLD_INTERFACE_H && HAVE_PDSC_H) \
00052 || (HAVE_EXCEPTION_H && HAVE_RLD_INTERFACE_H) \
00053 || defined PROG_PSTACK \
00054 || defined _WIN32 \
00055 || __GNUC__ > 3 \
00056 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
00057 # define HAVE_STACK_BACKTRACE 1
00058 # endif
00059
00060
00061
00062
00063
00064
00065 # define CLASSLIB_FASTEST_TYPE_INT 1
00066
00067
00068
00069
00070
00071
00072 #if !HAVE_NAMESPACE_STD
00073 # define std
00074 #endif
00075
00076 #if HAVE_CXX_STDC_HEADERS
00077 # define STDC std
00078 #else
00079 # define STDC
00080 #endif
00081
00082 # if !HAVE_BOOL
00083 # ifndef bool
00084 typedef int bool;
00085 # endif
00086 # ifndef true
00087 # define true 1
00088 # endif
00089 # ifndef false
00090 # define false 0
00091 # endif
00092 # endif
00093
00094 # if !HAVE_TYPENAME
00095 # define typename
00096 # endif
00097
00098 # if !HAVE_EXPLICIT
00099 # define explicit
00100 # endif
00101
00102 # if !HAVE_RESTRICT
00103 # if HAVE_PRIVATE_RESTRICT
00104 # define restrict __restrict
00105 # else
00106 # define restrict
00107 # endif
00108 # endif
00109
00110 # if !HAVE_USING
00111 # define USING(x)
00112 # else
00113 # define USING(x) using x
00114 # endif
00115
00116 # if HAVE_NEW_STYLE_CASTS
00117 # define STATIC_CAST(type,expr) static_cast<type> (expr)
00118 # define CONST_CAST(type,expr) const_cast<type> (expr)
00119 # define REINTERPRET_CAST(type,expr) reinterpret_cast<type> (expr)
00120 # else
00121 # define STATIC_CAST(type,expr) ((type)(expr))
00122 # define CONST_CAST(type,expr) ((type)(expr))
00123 # define REINTERPRET_CAST(type,expr) ((type)(expr))
00124 # endif
00125
00126 # if HAVE_DYNAMIC_CAST && HAVE_TYPEID
00127 # define HAVE_FUNCTIONAL_RTTI 1
00128 # endif
00129
00130 # if HAVE_TEMPLATE_NULL_ARGS
00131 # define CLASSLIB_TEMPLATE_NULL_ARGS <>
00132 # else
00133 # define CLASSLIB_TEMPLATE_NULL_ARGS
00134 # endif
00135
00136 # if HAVE_TEMPLATE_NULL_SPEC
00137 # define CLASSLIB_TEMPLATE_NULL_SPEC template<>
00138 # else
00139 # define CLASSLIB_TEMPLATE_NULL_SPEC
00140 # endif
00141
00142 # undef CLASSLIB_FUNCTION
00143 # if HAVE_PRETTY_FUNCTION
00144 # define CLASSLIB_FUNCTION __PRETTY_FUNCTION__
00145 # elif HAVE_FUNCTION
00146 # define CLASSLIB_FUNCTION __FUNCTION__
00147 # elif HAVE_FUNC
00148 # define CLASSLIB_FUNCTION __func__
00149 # endif
00150
00151 # if HAVE_ITERATOR
00152 # define ITERATOR_BASE(cat,val,diff) : public std::iterator<std::cat##_tag,val,diff>
00153 # elif HAVE_ITERATOR_TRAITS
00154 # define ITERATOR_BASE(cat,val,diff)
00155 # else
00156 # define ITERATOR_BASE(cat,val,diff) : public std::cat<val,diff>
00157 # endif
00158
00159 # if HAVE_REVERSE_ITERATOR_STYLE == 1
00160 # define REVERSE_ITERATOR(tname,tag,iter,value,reference,pointer,difference) \
00161 std::reverse_iterator<iter>
00162 # elif HAVE_REVERSE_ITERATOR_STYLE == 2
00163 # define REVERSE_ITERATOR(tname,tag,iter,value,reference,pointer,difference) \
00164 std::reverse_iterator<iter,std::tag,value,reference,pointer,difference>
00165 # elif HAVE_REVERSE_ITERATOR_STYLE == 3
00166 # define REVERSE_ITERATOR(tname,tag,iter,value,reference,pointer,difference) \
00167 std::tname<iter,value,reference,pointer,difference>
00168 # elif HAVE_REVERSE_ITERATOR_STYLE == 4
00169 # define REVERSE_ITERATOR(tname,tag,iter,value,reference,pointer,difference) \
00170 std::os_##tname<iter,value,reference,pointer,difference>
00171 # else
00172 # define REVERSE_ITERATOR(tname,tag,iter,value,reference,pointer,difference) \
00173 I_don_t_know_how_to_define_reverse_iterator
00174 # endif
00175
00176 # ifdef _MSC_VER
00177 # pragma warning(disable:4786)
00178 # pragma warning(disable:4305)
00179 # pragma warning(disable:4800)
00180 # endif
00181
00182 #endif