00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __OMNI_DEFS_HPP_
00020 #define __OMNI_DEFS_HPP_
00021
00022 namespace omni
00023 {
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 class NonCopyable {
00065 protected:
00066 NonCopyable() {}
00067 ~NonCopyable() {}
00068
00069 private:
00070 NonCopyable& operator=(const NonCopyable&);
00071 NonCopyable(const NonCopyable&);
00072 };
00073
00074 }
00075
00076
00077 #if !defined(OMNI_DOCUMENTATION_MODE)
00078
00079
00080
00081 #if defined(_MSC_VER) && (1400 <= _MSC_VER) // Visual C++ 8.0
00082 # define OMNI_EXCEPTION_SPEC
00083 # ifndef OMNI_MT
00084 # define OMNI_MT 1 // always multi-thread
00085 # endif // OMNI_MT
00086
00087 #elif defined(_MSC_VER) && (1300 <= _MSC_VER) // Visual C++ 7.0/7.1
00088
00089
00090 #elif defined(_MSC_VER) && (1200 <= _MSC_VER) // Visual C++ 6.0
00091 # pragma warning(disable: 4786) // identifier was truncated to '255' characters in the debug information
00092 # define OMNI_USE_FACET(loc, fac) std::_USE(loc, fac) // (!)
00093 # define OMNI_FIX_FOR_SCOPE
00094
00095 #elif defined(__BORLANDC__) && (0x0560 <= __BORLANDC__) // Borland C++ Builder 6.0
00096 # define OMNI_EXCEPTION_SPEC
00097
00098 #elif defined(__GNUC__) // gcc
00099 # define OMNI_EXCEPTION_SPEC
00100
00101 #elif defined(__EDG__) && defined(__COMO__) // Comeau C++
00102
00103
00104 #else
00105 # pragma message("OMNI warning: unknown compiler")
00106 #endif
00107
00108
00109
00110
00111 #if !defined(OMNI_DEBUG)
00112 # if defined(_DEBUG)
00113 # define OMNI_DEBUG 1
00114 # else
00115 # define OMNI_DEBUG 0
00116 # endif
00117 #endif
00118
00119
00120
00121 #if OMNI_DEBUG
00122 # define OMNI_DEBUG_CODE(code) code
00123 # if defined(OMNI_SHOW_REMARK)
00124 # pragma message("OMNI remark: debug mode enabled")
00125 # endif
00126 #else
00127 # define OMNI_DEBUG_CODE(code)
00128 # if defined(OMNI_SHOW_REMARK)
00129 # pragma message("OMNI remark: debug mode disabled")
00130 # endif
00131 #endif
00132
00133
00134
00135
00136 #if !defined(OMNI_MT)
00137 # if defined(_MT)
00138 # define OMNI_MT 1
00139 # else
00140 # define OMNI_MT 0
00141 # endif
00142 #endif
00143
00144
00145
00146 #if OMNI_MT
00147 # define OMNI_MT_CODE(code) code
00148 # if defined(OMNI_SHOW_REMARK)
00149 # pragma message("OMNI remark: multi-thread mode enabled")
00150 # endif
00151 #else
00152 # define OMNI_MT_CODE(code)
00153 # if defined(OMNI_SHOW_REMARK)
00154 # pragma message("OMNI remark: multi-thread mode disabled")
00155 # endif
00156 #endif
00157
00158
00159
00160
00161 #if !defined(OMNI_UNICODE)
00162 # if defined(UNICODE) || defined(_UNICODE)
00163 # define OMNI_UNICODE 1
00164 # else
00165 # define OMNI_UNICODE 0
00166 # endif
00167 #endif
00168
00169
00170
00171
00172 #if defined(OMNI_FIX_FOR_SCOPE)
00173 # define for if (false) {} else for
00174 # if defined(OMNI_SHOW_REMARK)
00175 # pragma message("OMNI remark: for scope fixed")
00176 # endif
00177 #endif
00178
00179
00180
00181
00182 #if defined(OMNI_EXCEPTION_SPEC)
00183 # define OMNI_THROW0() throw()
00184 #else
00185 # define OMNI_THROW0()
00186 #endif
00187
00188
00189
00190
00191 #if !defined(OMNI_USE_FACET)
00192 # define OMNI_USE_FACET(loc, fac) std::use_facet<fac>(loc)
00193 #endif
00194
00195 #endif // !OMNI_DOCUMENTATION_MODE
00196
00197 #endif // __OMNI_DEFS_HPP_