features.h

来自「stl的源码」· C头文件 代码 · 共 1,080 行 · 第 1/3 页

H
1,080
字号
 /*  *  * Copyright (c) 1994  * Hewlett-Packard Company  *  * Copyright (c) 1996,1997  * Silicon Graphics Computer Systems, Inc.  *  * Copyright (c) 1997  * Moscow Center for SPARC Technology  *  * Copyright (c) 1999  * Boris Fomitchev  *  * This material is provided "as is", with absolutely no warranty expressed  * or implied. Any use is at your own risk.  *  * Permission to use or copy this software for any purpose is hereby granted  * without fee, provided the above notices are retained on all copies.  * Permission to modify the code and to distribute modified code is granted,  * provided the above notices are retained, and a notice that the code was  * modified is included with the above copyright notice.  *  */#ifndef _STLP_FEATURES_H#define _STLP_FEATURES_H/* * Purpose of this file: * * Defines all STLport settings. * This file is actually a wrapper : it includes compiler-specific * settings from <config/stlcomp.h> * and user-defined settings from <config/user_config.h>. * See <config/stl_mycomp.h> and <config/user_config.h> for the description * of those macros * *//* Definition of the STLport version informations */#include <stl/_stlport_version.h>/* Other macros defined by this file: * bool, true, and false, if _STLP_NO_BOOL is defined. * typename, as a null macro if it's not already a keyword. * explicit, as a null macro if it's not already a keyword. * namespace-related macros (_STLP_STD, _STLP_BEGIN_NAMESPACE, etc.) * exception-related macros (_STLP_TRY, _STLP_UNWIND, etc.) * _STLP_ASSERT, either as a test or as a null macro, depending on   whether or not _STLP_ASSERTIONS is defined.*//* Definition of the 2 STLport debug levels */#define _STLP_STLPORT_DBG_LEVEL 1#define _STLP_STANDARD_DBG_LEVEL 2/* Placeholder for user to override settings. * It could be also used to mask settings from * different directories. */#include <stl/config/user_config.h>#if defined (_STLP_DEBUG) && !defined (_STLP_DEBUG_LEVEL)#  define _STLP_DEBUG_LEVEL _STLP_STLPORT_DBG_LEVEL#endif#if defined (__BUILDING_STLPORT)/* For the STLport implementation we can use everything: */#  if defined (_STLP_NO_ANACHRONISMS)#    undef _STLP_NO_ANACHRONISMS#  endif#  if defined (_STLP_NO_EXTENSIONS)#    undef _STLP_NO_EXTENSIONS#  endif/* Moreover there are things that have no sens: */#  if defined (_STLP_NO_IOSTREAMS)#    error If you do not use iostreams you do not need to build the STLport library.#  endif#endif/* ========================================================= *//* This file is used for compatibility; it accepts old-style config   switches */#include <stl/config/compat.h>/* Common configuration file for this particular installation. */#include <stl/config/host.h>/* Operational Environment specific */#include <stl/config/_system.h>/* ========================================================= *//* some fixes to configuration. This also includes modifications * of STLport switches depending on compiler flags, * or settings applicable to a group of compilers, such as * to all who use EDG front-end. */#include <stl/config/stl_confix.h>#if !defined (_STLP_NO_MEMBER_TEMPLATES) && !defined (_STLP_MEMBER_TEMPLATES)#  define _STLP_MEMBER_TEMPLATES 1#endif#if !defined (_STLP_NO_MEMBER_TEMPLATE_CLASSES) && !defined (_STLP_MEMBER_TEMPLATE_CLASSES)#  define _STLP_MEMBER_TEMPLATE_CLASSES 1#endif#if defined (_STLP_NO_MEMBER_TEMPLATE_CLASSES) && !defined (_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE)#  define _STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE 1#endif#if !defined (_STLP_NO_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)#  define _STLP_CLASS_PARTIAL_SPECIALIZATION 1#endif#if !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER) && !defined (_STLP_NO_FUNCTION_TMPL_PARTIAL_ORDER)#  define _STLP_FUNCTION_TMPL_PARTIAL_ORDER 1#endif#if !defined (_STLP_DONT_USE_SHORT_STRING_OPTIM) && !defined (_STLP_USE_SHORT_STRING_OPTIM)#  define _STLP_USE_SHORT_STRING_OPTIM 1#endif#if defined (_STLP_MEMBER_TEMPLATES) && !defined (_STLP_NO_EXTENSIONS) && \   !defined (_STLP_NO_CONTAINERS_EXTENSION) && !defined (_STLP_USE_CONTAINERS_EXTENSION)#  define _STLP_USE_CONTAINERS_EXTENSION#endif#if defined (_STLP_USE_CONTAINERS_EXTENSION)#  define _STLP_TEMPLATE_FOR_CONT_EXT template <class _KT>#else#  define _STLP_TEMPLATE_FOR_CONT_EXT#endif#if defined (_STLP_USE_PTR_SPECIALIZATIONS) && \    (defined (_STLP_NO_CLASS_PARTIAL_SPECIALIZATION) && defined (_STLP_DONT_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS))#  error Sorry but according the STLport settings your compiler can not support the pointer specialization feature.#endif#if defined (_STLP_WHOLE_NATIVE_STD) && defined (_STLP_NO_OWN_NAMESPACE)#  error Sorry but asking for both STLport to be in the real std namespace and also having STLport import all native std stuff \  is invalid, chose one or none.#endif#if defined (_STLP_VERBOSE) && !defined (_STLP_VERBOSE_MODE_SUPPORTED)#  error Sorry but the verbose mode is not implemented for your compiler.#endif#if defined (_STLP_NO_IOSTREAMS) && \   !defined (_STLP_USE_NEWALLOC) && !defined (_STLP_USE_MALLOC)#  define _STLP_USE_NEWALLOC#endif#if !defined (_STLP_BIG_ENDIAN) && !defined (_STLP_LITTLE_ENDIAN)#  if defined (_MIPSEB) || defined (__sparc) || defined (_AIX) || \      defined (__hpux) || defined (macintosh) || defined (_MAC)#    define _STLP_BIG_ENDIAN 1#  elif defined (__i386) || defined (_M_IX86) || defined (_M_ARM) || \        defined (__amd64__) || defined (_M_AMD64) || defined (__x86_64__) || \        defined (__alpha__)#    define _STLP_LITTLE_ENDIAN 1#  elif defined (__ia64__)    /* itanium allows both settings (for instance via gcc -mbig-endian) - hence a seperate check is required */#    if defined (__BIG_ENDIAN__)#      define _STLP_BIG_ENDIAN 1#    else#      define _STLP_LITTLE_ENDIAN 1#    endif#  else#    error "can't determine endianess"#  endif#endif /* _STLP_BIG_ENDIAN *//* ========================================================== * final workaround tuning based on given flags * ========================================================== */#ifndef _STLP_UINT32_T#  define _STLP_UINT32_T unsigned long#endif#ifndef _STLP_ABORT#  define _STLP_ABORT() abort()#endif#if !defined (_STLP_HAS_NO_NAMESPACES)#  if defined _STLP_NO_NAMESPACES#    undef _STLP_USE_NAMESPACES#  else/* assume it as the default, turn it off later if NO_NAMESPACES selected */#    undef _STLP_USE_NAMESPACES#    define _STLP_USE_NAMESPACES 1#  endif#endif#if defined (_STLP_NO_IOSTREAMS)#  define _STLP_USE_NO_IOSTREAMS#endif/* Operating system recognition (basic) */#if (defined(__unix) || defined(__linux__) || defined(__QNX__) || defined(_AIX)  || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__Lynx__) || defined(__hpux) || defined(__sgi)) && \     !defined (_STLP_UNIX)#  define _STLP_UNIX 1#endif /* __unix */#if !defined (_STLP_NO_LONG_DOUBLE)#  define _STLP_LONGEST_FLOAT_TYPE long double#else#  define _STLP_LONGEST_FLOAT_TYPE double#endif/* Native headers access macros */#if !defined (_STLP_HAS_INCLUDE_NEXT)#  include <stl/config/_native_headers.h>#endif/*  shared library tune-up */#if defined (__BUILDING_STLPORT)/*  if we are rebuilding right now, place everything here */#  undef  _STLP_DESIGNATED_DLL#  define _STLP_DESIGNATED_DLL 1#endif/* Use own namespace always if possible and not explicitly instructed otherwise */#if defined (_STLP_USE_NAMESPACES) && !defined (_STLP_BROKEN_USING_DIRECTIVE) && \   !defined (_STLP_NO_OWN_NAMESPACE)#  undef  _STLP_USE_OWN_NAMESPACE#  define _STLP_USE_OWN_NAMESPACE  1#else#  undef _STLP_WHOLE_NATIVE_STD#endif#if !defined (_NOTHREADS) && !defined (_STLP_THREADS_DEFINED)#  if defined (_PTHREADS)#    define _STLP_PTHREADS#    define _STLP_THREADS#  endif#  if defined (_UITHREADS)#    define _STLP_UITHREADS#    define _STLP_THREADS#  endif#  if defined (_STLP_WIN32) && !defined (_STLP_PTHREADS)#    define _STLP_WIN32THREADS 1#  elif ((defined (__sun) && !defined (__linux__)) || defined (_UITHREADS) ) && \        !defined(_STLP_PTHREADS)#    define _STLP_UITHREADS#  else#    define _STLP_PTHREADS#  endif /* __sgi */#  define _STLP_THREADS_DEFINED#endif#if (defined (_REENTRANT) || defined (_THREAD_SAFE)) && !defined (_STLP_THREADS)#  define _STLP_THREADS#endif#ifndef _STLP_STATIC_MUTEX#  define _STLP_STATIC_MUTEX _STLP_mutex_base#endif#if (defined (_MFC_VER) || defined (_AFXDLL)) && !defined (_STLP_USE_MFC)#  define _STLP_USE_MFC 1#endif#if defined (_STLP_THREADS)#  define _STLP_VOLATILE volatile#else#  define _STLP_VOLATILE#endif#if !defined (_STLP_USE_NEW_C_HEADERS) && !defined (_STLP_HAS_NO_NEW_C_HEADERS)#  define _STLP_USE_NEW_C_HEADERS#endif/* disable new-style headers if requested */#if defined (_STLP_NO_NEW_C_HEADERS)#  undef _STLP_USE_NEW_C_HEADERS#endif#if defined (_STLP_BASE_TYPEDEF_BUG)#  undef  _STLP_BASE_TYPEDEF_OUTSIDE_BUG#  define _STLP_BASE_TYPEDEF_OUTSIDE_BUG 1#endif#if defined (_STLP_NESTED_TYPE_PARAM_BUG)#  define _STLP_GLOBAL_NESTED_RETURN_TYPE_PARAM_BUG#endif/* SUNpro 4.2 inline string literal bug */#ifdef _STLP_INLINE_STRING_LITERAL_BUG#  define _STLP_FIX_LITERAL_BUG(__x) __x = __x;#else#  define _STLP_FIX_LITERAL_BUG(__x)#endif#if defined (_STLP_NON_TYPE_TMPL_PARAM_BUG)#  undef  _STLP_NO_DEFAULT_NON_TYPE_PARAM#  define _STLP_NO_DEFAULT_NON_TYPE_PARAM 1#endif#if !defined (_STLP_STATIC_ASSERT)/* Some compiler support 0 size array so we use negative size array to generate * a compilation time error. */#  define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1];#endif/* apple mpw exception handling bug */#ifndef _STLP_MPWFIX_TRY#  define _STLP_MPWFIX_TRY#endif#ifndef _STLP_MPWFIX_CATCH#  define _STLP_MPWFIX_CATCH#endif#ifndef _STLP_MPWFIX_CATCH_ACTION#  define _STLP_MPWFIX_CATCH_ACTION(action)#endif#if !defined (_STLP_WEAK)#  define _STLP_WEAK#endif/* default parameters as template types derived from arguments ( not always supported ) */#if defined (_STLP_LIMITED_DEFAULT_TEMPLATES)#  define _STLP_DFL_TMPL_PARAM( classname, defval ) class classname#else#  if !defined (_STLP_DEFAULT_TYPE_PARAM)#    define _STLP_DEFAULT_TYPE_PARAM 1#  endif#  define _STLP_DFL_TMPL_PARAM( classname, defval ) class classname = defval#endif#if defined (_STLP_LIMITED_DEFAULT_TEMPLATES)#  define _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_Key, _Tp ) class _Alloc#else#  define _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_Key, _Tp ) \            class _Alloc = allocator< pair < _Key, _Tp > >#endif/* default parameters as complete types */#if defined (_STLP_DEFAULT_TYPE_PARAM)#  define _STLP_DFL_TYPE_PARAM( classname, defval ) class classname = defval#  define _STLP_DFL_NON_TYPE_PARAM(type,name,val) type name = val#else#  define _STLP_DFL_TYPE_PARAM( classname, defval ) class classname#  define _STLP_DFL_NON_TYPE_PARAM(type,name,val) type name#endif/* SGI compatibility */#ifdef _STLP_NO_WCHAR_T#  ifndef _STLP_NO_NATIVE_WIDE_STREAMS#    define  _STLP_NO_NATIVE_WIDE_STREAMS 1#  endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?