/home/ntakagi/work/STLport-5.1.5/stlport/stl/config/_gcc.h

Go to the documentation of this file.
00001 /* STLport configuration file
00002  * It is internal STLport header - DO NOT include it directly
00003  */
00004 
00005 #define _STLP_COMPILER "gcc"
00006 
00007 /* Systems having GLIBC installed have different traits */
00008 #if defined (__linux__)
00009 #  ifndef _STLP_USE_GLIBC
00010 #    define _STLP_USE_GLIBC 1
00011 #  endif
00012 #  if defined (__UCLIBC__) && !defined (_STLP_USE_UCLIBC)
00013 #    define _STLP_USE_UCLIBC 1
00014 #  endif
00015 #endif
00016 
00017 #if defined (__CYGWIN__) && \
00018      (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 3) && !defined (_GLIBCPP_USE_C99)
00019 #  define _STLP_NO_VENDOR_MATH_L
00020 #  define _STLP_NO_VENDOR_STDLIB_L
00021 #endif
00022 
00023 #if (__GNUC__ < 3)
00024 #  define _STLP_NO_VENDOR_STDLIB_L
00025 #endif
00026 
00027 /* We guess if we are using the cygwin distrib that has a special include schema.
00028  * There is no way to distinguish a cygwin distrib used in no-cygwin mode from a
00029  * mingw install. We are forced to use a configuration option
00030  */
00031 #if !defined (_STLP_NATIVE_INCLUDE_PATH) && \
00032     (defined (__CYGWIN__) || defined (__MINGW32__) && defined (_STLP_NO_CYGWIN))
00033 #  if (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 3))
00034 #    define _STLP_NATIVE_INCLUDE_PATH ../../../__GNUC__.__GNUC_MINOR__.__GNUC_PATCHLEVEL__/include/c++
00035 #  elif defined (_STLP_NO_CYGWIN)
00036 #    define _STLP_NATIVE_INCLUDE_PATH ../mingw
00037 /*#  else
00038  * Before version gcc 3.4, the cygwin package include path was conform to the
00039  * GNU convention which is set later in this file.
00040  */
00041 #  endif
00042 #endif
00043 
00044 #if (__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 4))
00045 /* define for gcc versions before 3.4.0. */
00046 #  define _STLP_NO_MEMBER_TEMPLATE_KEYWORD
00047 #endif
00048 
00049 /* azov: gcc on lynx have a bug that causes internal
00050  * compiler errors when compiling STLport with namespaces turned on.
00051  * When the compiler gets better - comment out _STLP_HAS_NO_NAMESPACES
00052  */
00053 #if defined (__Lynx__) && (__GNUC__ < 3)
00054 #  define _STLP_HAS_NO_NAMESPACES 1
00055 #  define _STLP_NO_STATIC_TEMPLATE_DATA 1
00056 /* turn off useless warning about including system headers */
00057 #  define __NO_INCLUDE_WARN__ 1
00058 #endif
00059 
00060 /* Tru64 Unix, AIX, HP : gcc there by default uses native ld and hence cannot auto-instantiate
00061    static template data. If you are using GNU ld, please say so in user_config.h header */
00062 #if (__GNUC__ < 3) && !defined(_STLP_GCC_USES_GNU_LD) && \
00063    ((defined (__osf__) && defined (__alpha__)) || defined (_AIX) || defined (__hpux) || defined(__amigaos__) )
00064 #  define _STLP_NO_STATIC_TEMPLATE_DATA
00065 #endif
00066 
00067 #if !defined (_REENTRANT) && (defined (_THREAD_SAFE) || \
00068                              (defined (__OpenBSD__) && defined (_POSIX_THREADS)) || \
00069                              (defined (__MINGW32__) && defined (_MT)))
00070 #  define _REENTRANT
00071 #endif
00072 
00073 #if defined (__DJGPP)
00074 #  define _STLP_RAND48    1
00075 #  define _NOTHREADS    1
00076 #  undef  _PTHREADS
00077 #  define _STLP_LITTLE_ENDIAN
00078 #endif
00079 
00080 #if defined (__MINGW32__)
00081 /* Mingw32, egcs compiler using the Microsoft C runtime */
00082 #  define _STLP_VENDOR_GLOBAL_CSTD
00083 #  undef  _STLP_NO_DRAND48
00084 #  define _STLP_NO_DRAND48
00085 #  define _STLP_CALL
00086 
00087 #  if defined (_STLP_NEW_PLATFORM_SDK)
00088 /* For the moment the Windows SDK coming with Mingw still mimik the old platform SDK. */
00089 #    undef _STLP_NEW_PLATFORM_SDK
00090 #  endif
00091 #endif /* __MINGW32__ */
00092 
00093 #if defined (__CYGWIN__) || defined (__MINGW32__)
00094 #  if !defined (_STLP_USE_STATIC_LIB)
00095 #    define _STLP_USE_DECLSPEC 1
00096 #    if !defined (_STLP_USE_DYNAMIC_LIB)
00097 #      define _STLP_USE_DYNAMIC_LIB
00098 #    endif
00099 #    define _STLP_EXPORT_DECLSPEC __declspec(dllexport)
00100 #    define _STLP_CLASS_EXPORT_DECLSPEC __declspec(dllexport)
00101 #    define _STLP_CLASS_IMPORT_DECLSPEC __declspec(dllimport)
00102 #  endif
00103 /* The following is defined independently of _STLP_USE_STATIC_LIB because it is also
00104  * used to import symbols from PSDK under MinGW
00105  */
00106 #  define _STLP_IMPORT_DECLSPEC __declspec(dllimport)
00107 #endif
00108 
00109 #if defined (__CYGWIN__) || defined (__MINGW32__) || !(defined (_STLP_USE_GLIBC) || defined (__sun) || defined(__APPLE__))
00110 #  if !defined (__MINGW32__) && !defined (__CYGWIN__)
00111 #    define _STLP_NO_NATIVE_MBSTATE_T    1
00112 #  endif
00113 #  if !defined (__MINGW32__) || (__GNUC__ < 3) || (__GNUC__ == 3) && (__GNUC_MINOR__ < 4)
00114 #    define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
00115 #  endif
00116 #  define _STLP_NO_NATIVE_WIDE_STREAMS   1
00117 #endif
00118 
00119 #define _STLP_NORETURN_FUNCTION __attribute__((noreturn))
00120 
00121 /* Mac OS X is a little different with namespaces and cannot instantiate
00122  * static data members in template classes */
00123 #if defined (__APPLE__)
00124 #  if ((__GNUC__ < 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ < 3)))
00125 /* Mac OS X is missing a required typedef and standard macro */
00126 typedef unsigned int wint_t;
00127 #  endif
00128 
00129 #  define __unix
00130 
00131 #  if (__GNUC__ < 3)
00132 
00133  /* Mac OS X needs one and only one source file to initialize all static data
00134   * members in template classes. Only one source file in an executable or
00135   * library can declare instances for such data members, otherwise duplicate
00136   * symbols will be generated. */
00137 
00138 #    define _STLP_NO_STATIC_TEMPLATE_DATA
00139 #    define _STLP_STATIC_CONST_INIT_BUG 1
00140 #    define _STLP_STATIC_TEMPLATE_DATA 0
00141 #    define _STLP_WEAK_ATTRIBUTE 1
00142  /* Workaround for the broken Mac OS X C++ preprocessor which cannot handle
00143   * parameterized macros in #include statements */
00144 #    define _STLP_NATIVE_HEADER(header) <../g++/##header##>
00145 #    define _STLP_NATIVE_C_HEADER(header) <../include/##header##>
00146 #    define _STLP_NATIVE_CPP_C_HEADER(header) <../g++/##header##>
00147 #    define _STLP_NATIVE_OLD_STREAMS_HEADER(header) <../g++/##header##>
00148 #    define _STLP_NATIVE_CPP_RUNTIME_HEADER(header) <../g++/##header##>
00149 #  endif /* __GNUC__ < 3 */
00150 
00151 #  define _STLP_NO_LONG_DOUBLE
00152 
00153 /* Mac OS X needs all "::" scope references to be "std::" */
00154 #  define _STLP_USE_NEW_C_HEADERS
00155 
00156 #  define _STLP_NO_VENDOR_STDLIB_L
00157 
00158 #endif /* __APPLE__ */
00159 
00160 
00161 #if defined(__BEOS__) && defined(__INTEL__)
00162 #  define _STLP_NATIVE_HEADER(header) <../stlport/beos/##header##>
00163 #  define _STLP_NATIVE_C_HEADER(header) <../stlport/beos/##header##>
00164 #  define _STLP_NATIVE_CPP_C_HEADER(header) <../stlport/beos/##header##>
00165 #  define _STLP_NATIVE_OLD_STREAMS_HEADER(header) <../stlport/beos/##header##>
00166 #  define _STLP_NATIVE_CPP_RUNTIME_HEADER(header) <../stlport/beos/##header##>
00167 #  define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
00168 #  define _STLP_NO_NATIVE_WIDE_STREAMS   1
00169 /*
00170 #  define _NOTHREADS 1
00171 */
00172 #  ifdef _PTHREADS
00173 #    undef  _PTHREADS
00174 #  endif
00175 #  ifdef _STLP_PTHREADS
00176 #    undef _STLP_PTHREADS
00177 #  endif
00178 #  define _STLP_USE_STDIO_IO 1
00179 #  define _STLP_USE_GLIBC 1
00180 #endif
00181 
00182 /* g++ 2.7.x and above */
00183 #define _STLP_LONG_LONG long long
00184 
00185 #ifdef _STLP_USE_UCLIBC
00186 /*
00187 #  ifndef __DO_C99_MATH__
00188 */
00189   /* No *f math fuctions variants (i.e. sqrtf, fabsf, etc.) */
00190 #  define _STLP_NO_VENDOR_MATH_F
00191   /* No *l math fuctions variants (i.e. sqrtl, fabsl, etc.) */
00192 #  define _STLP_NO_VENDOR_MATH_L
00193 #  define _STLP_NO_LONG_DOUBLE
00194 /*
00195 #  endif
00196 */
00197 #endif
00198 
00199 #if defined (__OpenBSD__) || defined (__FreeBSD__)
00200 #  define _STLP_NO_VENDOR_MATH_L
00201 #  define _STLP_NO_VENDOR_STDLIB_L /* no llabs */
00202 #  ifndef __unix
00203 #    define __unix
00204 #  endif
00205 #endif
00206 
00207 #if defined (__alpha__)
00208 #  define _STLP_NO_VENDOR_MATH_L
00209 #  define _STLP_NO_IEC559_SUPPORT
00210 #endif
00211 
00212 #if defined (__hpux)
00213 #  define _STLP_NO_VENDOR_STDLIB_L /* no llabs */
00214   /* No *f math fuctions variants (i.e. sqrtf, fabsf, etc.) */
00215 #  define _STLP_NO_VENDOR_MATH_F
00216 #endif
00217 
00218 #if (__GNUC__ >= 3)
00219 #  ifndef _STLP_HAS_NO_NEW_C_HEADERS
00220 /*
00221 #    ifndef _STLP_USE_UCLIBC
00222 */
00223 #    define _STLP_HAS_NATIVE_FLOAT_ABS
00224 /*
00225 #    endif
00226 */
00227 #  else
00228 #    ifdef _STLP_USE_GLIBC
00229 #      define _STLP_VENDOR_LONG_DOUBLE_MATH  1
00230 #    endif
00231 #  endif
00232 #endif
00233 
00234 #if (__GNUC__ < 3)
00235 #  define _STLP_HAS_NO_NEW_C_HEADERS     1
00236 #  define _STLP_VENDOR_GLOBAL_CSTD       1
00237 #  define _STLP_DONT_USE_PTHREAD_SPINLOCK 1
00238 #  ifndef __HONOR_STD
00239 #    define _STLP_VENDOR_GLOBAL_EXCEPT_STD 1
00240 #  endif
00241 /* egcs fails to initialize builtin types in expr. like this : new(p) char();  */
00242 #  define _STLP_DEF_CONST_PLCT_NEW_BUG 1
00243 #endif
00244 
00245 /*
00246 #define _STLP_VENDOR_GLOBAL_CSTD 1
00247 */
00248 
00249 #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 95)
00250 #  define _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT
00251 #  define _STLP_NO_UNEXPECTED_EXCEPT_SUPPORT
00252 #  define _STLP_DEF_CONST_DEF_PARAM_BUG 1
00253 #else
00254 #  undef _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT
00255 #  undef _STLP_NO_UNEXPECTED_EXCEPT_SUPPORT
00256 #endif
00257 
00258 #if (__GNUC_MINOR__ < 9)  && (__GNUC__ < 3) /* gcc 2.8 */
00259 #  define _STLP_NO_TEMPLATE_CONVERSIONS
00260 #  define _STLP_NO_MEMBER_TEMPLATE_CLASSES 1
00261 #  define _STLP_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
00262 #  define _STLP_NO_FRIEND_TEMPLATES 1
00263 #  define _STLP_HAS_NO_NAMESPACES 1
00264 #  define _STLP_NO_METHOD_SPECIALIZATION 1
00265 #  define _STLP_NO_MEMBER_TEMPLATES 1
00266 #  define _STLP_NO_CLASS_PARTIAL_SPECIALIZATION 1
00267 #  define _STLP_DONT_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS
00268 /*  DJGPP doesn't seem to implement it in 2.8.x */
00269 #  ifdef DJGPP
00270 #    define  _STLP_NO_STATIC_TEMPLATE_DATA 1
00271 #  endif
00272 #endif
00273 
00274 #if __GNUC__ <= 2 && __GNUC_MINOR__ <= 7 && !defined (__CYGWIN32__)
00275 /* Will it work with 2.6 ? I doubt it. */
00276 #  if ( __GNUC_MINOR__ < 6 )
00277 __GIVE_UP_WITH_STL(GCC_272);
00278 #  endif
00279 
00280 #  define  _STLP_NO_RELOPS_NAMESPACE
00281 #  define  _STLP_NON_TYPE_TMPL_PARAM_BUG
00282 #  define  _STLP_LIMITED_DEFAULT_TEMPLATES 1
00283 #  define  _STLP_DEFAULT_TYPE_PARAM 1
00284 #  define  _STLP_NO_BAD_ALLOC
00285 #  define  _STLP_NO_ARROW_OPERATOR 1
00286 #  ifndef _STLP_NO_STATIC_TEMPLATE_DATA
00287 #    define  _STLP_NO_STATIC_TEMPLATE_DATA
00288 #  endif
00289 #  define  _STLP_STATIC_CONST_INIT_BUG 1
00290 #  define  _STLP_NO_METHOD_SPECIALIZATION 1
00291 
00292 #  if !defined (__CYGWIN32__)
00293 #    define _STLP_NESTED_TYPE_PARAM_BUG   1
00294 #    define _STLP_BASE_MATCH_BUG       1
00295 /*  unused operators are required (forward) */
00296 #    define  _STLP_CONST_CONSTRUCTOR_BUG
00297 #    define _STLP_NO_DEFAULT_NON_TYPE_PARAM
00298 #  endif
00299 #  define _STLP_NO_PARTIAL_SPECIALIZATION_SYNTAX 1
00300 #  define _STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
00301 #  define _STLP_NO_EXCEPTION_HEADER 1
00302 #else /* ! <= 2.7.* */
00303 #endif /* ! <= 2.7.* */
00304 
00305 /* static template data members workaround strategy for gcc tries
00306  * to use weak symbols.
00307  * if you don't want to use that, #define _STLP_WEAK_ATTRIBUTE=0 ( you'll
00308  * have to put "#define __PUT_STATIC_DATA_MEMBERS_HERE" line in one of your
00309  * compilation unit ( or CFLAGS for it ) _before_ including any STL header ).
00310  */
00311 #if defined (_STLP_NO_STATIC_TEMPLATE_DATA) && ! defined (_STLP_WEAK_ATTRIBUTE )
00312 /* systems using GNU ld or format that supports weak symbols
00313    may use "weak" attribute
00314    Linux & Solaris ( x86 & SPARC ) are being auto-recognized here */
00315 #  if defined(_STLP_GNU_LD) || defined(__ELF__) || defined (__CYGWIN__) || \
00316      (( defined (__SVR4) || defined ( __svr4__ )) && \
00317       ( defined (sun) || defined ( __sun__ )))
00318 #    define _STLP_WEAK_ATTRIBUTE 1
00319 #  endif
00320 #endif /* _STLP_WEAK_ATTRIBUTE */
00321 
00322 
00323 /* strict ANSI prohibits "long long" ( gcc) */
00324 #if defined ( __STRICT_ANSI__ )
00325 #  undef _STLP_LONG_LONG
00326 /*
00327 #    define _STLP_STRICT_ANSI 1
00328 */
00329 #endif
00330 
00331 /*
00332 #if !defined (__STRICT_ANSI__) || defined (__BUILDING_STLPORT)
00333 #  define _STLP_USE_TEMPLATE_EXPORT
00334 #  define _STLP_EXPORT_TEMPLATE_KEYWORD extern
00335 #  define _STLP_IMPORT_TEMPLATE_KEYWORD extern
00336 #endif
00337 */
00338 
00339 #ifndef __EXCEPTIONS
00340 #  undef  _STLP_DONT_USE_EXCEPTIONS
00341 #  define _STLP_DONT_USE_EXCEPTIONS 1
00342 #endif
00343 
00344 #if (__GNUC__ >= 3)
00345 
00346 #  if !defined (_STLP_NATIVE_INCLUDE_PATH)
00347 #    if ( (__GNUC__ == 3 ) && ((__GNUC_MINOR__ == 0) || ((__GNUC_MINOR__ < 3) && defined(__APPLE_CC__))))
00348 #      define _STLP_NATIVE_INCLUDE_PATH ../g++-v3
00349 #    else
00350 #      if ( ((__GNUC__ == 4 ) || (__GNUC_MINOR__ >= 3)) && defined(__APPLE_CC__))
00351 #        define _STLP_NATIVE_INCLUDE_PATH ../c++
00352 /*
00353 * Before version 3.4.0 the 0 patch level was not part of the include path:
00354 */
00355 #      elif defined (__GNUC_PATCHLEVEL__) && ((__GNUC_PATCHLEVEL__ > 0) || \
00356                                               (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
00357                                               (__GNUC__ > 3))
00358 #        define _STLP_NATIVE_INCLUDE_PATH ../__GNUC__.__GNUC_MINOR__.__GNUC_PATCHLEVEL__
00359 #      else
00360 #        define _STLP_NATIVE_INCLUDE_PATH ../__GNUC__.__GNUC_MINOR__
00361 #      endif
00362 #    endif
00363 #  endif
00364 
00365 /* Instantiation scheme that used (default) in gcc 3 made void of sense explicit
00366    instantiation within library: nothing except increased library size. - ptr
00367  */
00368 #  define _STLP_NO_FORCE_INSTANTIATE
00369 
00370 #elif (__GNUC_MINOR__ < 8)
00371 
00372 #  if !defined (_STLP_NATIVE_INCLUDE_PATH)
00373 #    define _STLP_NATIVE_INCLUDE_PATH ../g++-include
00374 #  endif
00375 
00376 /* tuning of static template data members workaround */
00377 #  if ( _STLP_STATIC_TEMPLATE_DATA < 1 )
00378 #    if ( _STLP_WEAK_ATTRIBUTE > 0 )
00379 #      define _STLP_WEAK __attribute__ (( weak ))
00380 #    else
00381 #      define _STLP_WEAK
00382 #    endif /* _STLP_WEAK_ATTRIBUTE */
00383 
00384 #    ifdef __PUT_STATIC_DATA_MEMBERS_HERE
00385 #      define __DECLARE_INSTANCE(type,item,init) type item _STLP_WEAK init
00386 #    else
00387 #      define __DECLARE_INSTANCE(type,item,init)
00388 #    endif /* __PUT_STATIC_DATA_MEMBERS_HERE */
00389 #  endif /* _STLP_STATIC_TEMPLATE_DATA */
00390 
00391 #else
00392 
00393 /* gcc-2.95.0 used to use "g++-3" directory which has been changed to "g++" in
00394  * system-dependent "include" for 2.95.2 except for Cygwin and Mingw packages.
00395  * I expect "g++-3" not being used in later releases.
00396  * If your installation use "g++-3" include directory for any reason (pre-2.95.2 or Win binary kit),
00397  * please change the macro below to point to your directory.
00398  */
00399 
00400 #  if !defined (_STLP_NATIVE_INCLUDE_PATH)
00401 #    if defined(__DJGPP)
00402 #      define _STLP_NATIVE_INCLUDE_PATH ../lang/cxx
00403 #    elif (__GNUC__ >= 3) || (__GNUC_MINOR__ >= 97)
00404 #      define _STLP_NATIVE_INCLUDE_PATH ../include/g++-v3
00405 #    elif ((__GNUC_MINOR__ >= 95 && __GNUC_MINOR__ < 97) && \
00406           !( defined (__FreeBSD__) || defined (__NetBSD__) || defined(__sgi) || defined (__OS2__) ) )
00407 #      define _STLP_NATIVE_INCLUDE_PATH ../g++-3
00408 #    elif (__GNUC_MINOR__ > 8) && (__GNUC_MINOR__ < 95) && (__GNUC__ < 3) && !defined( __Lynx__ )
00409 /* this really sucks, as GNUpro does not really identifies itself, so we have to guess
00410  * depending on a platform
00411  */
00412 #      ifdef __hpux
00413 #        define _STLP_NATIVE_INCLUDE_PATH ../g++-3
00414 #      else
00415 #        define _STLP_NATIVE_INCLUDE_PATH ../g++-2
00416 #      endif
00417 #    else
00418 #      define _STLP_NATIVE_INCLUDE_PATH g++
00419 #    endif
00420 #  endif
00421 
00422 /* <exception> et al */
00423 #  ifdef __FreeBSD__
00424 #    if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ > 95)
00425 #      define _STLP_NATIVE_CPP_RUNTIME_INCLUDE_PATH ../include
00426 #    endif
00427 #  else
00428 /* azov */
00429 #    ifndef __Lynx__
00430 #      if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)
00431 /*
00432 #     define _STLP_NATIVE_CPP_RUNTIME_INCLUDE_PATH ../g++-v3
00433 */
00434 #      else
00435 #        define _STLP_NATIVE_CPP_RUNTIME_INCLUDE_PATH ../include
00436 #      endif
00437 #    endif
00438 #  endif
00439 
00440 #endif /* GNUC_MINOR < 8 */
00441 
00442 #if !defined (_STLP_NATIVE_C_INCLUDE_PATH)
00443 #  define _STLP_NATIVE_C_INCLUDE_PATH ../include
00444 #endif
00445 
00446 /* Tune settings for the case where static template data members are not
00447  * instaniated by default
00448  */
00449 #if defined ( _STLP_NO_STATIC_TEMPLATE_DATA )
00450 #  define _STLP_STATIC_TEMPLATE_DATA 0
00451 #  if !defined ( _STLP_WEAK_ATTRIBUTE )
00452 #    define _STLP_WEAK_ATTRIBUTE 0
00453 #  endif
00454 #  ifdef __PUT_STATIC_DATA_MEMBERS_HERE
00455 #    define __DECLARE_INSTANCE(type,item,init) type item init
00456 #  else
00457 #    define __DECLARE_INSTANCE(type,item,init)
00458 #  endif
00459 #else
00460 #  define _STLP_STATIC_TEMPLATE_DATA 1
00461 #endif
00462 



Generated on Mon Mar 10 15:32:46 2008 by  doxygen 1.5.1