features.h

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

H
1,080
字号
#else#  define _STLP_HAS_WCHAR_T 1#endif#if !defined (_STLP_NO_AT_MEMBER_FUNCTION)#  define _STLP_CAN_THROW_RANGE_ERRORS 1#endif/* debug mode tool */#if defined (_STLP_DEBUG)#  define _STLP_NON_DBG_NAME(X) _NonDbg_##X#endif/* pointer specialization tool */#if defined (_STLP_USE_PTR_SPECIALIZATIONS)#  define _STLP_PTR_IMPL_NAME(X) _Impl_##X#endif#if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) || \    defined (_STLP_SIGNAL_RUNTIME_COMPATIBILITY) || defined (_STLP_CHECK_RUNTIME_COMPATIBILITY)#  define _STLP_NO_MEM_T_NAME(X) _NoMemT_##X#endif/* this always mean the C library is in global namespace */#if defined (_STLP_HAS_NO_NEW_C_HEADERS) && !defined (_STLP_VENDOR_GLOBAL_CSTD)#  define _STLP_VENDOR_GLOBAL_CSTD 1#endif/* Depending of whether compiler supports namespaces, * tune the parameters for vendor-supplied libraries. * This section is guarded by _STLP_HAS_NO_NAMESPACES, not by _STLP_USE_NAMESPACES, * since it depends only on the native features, not on user's preference whether * to use namespace for STLport or not. */#if !defined (_STLP_HAS_NO_NAMESPACES)/* Import some vendor's headers into corresponding STLport ones if they might be needed * (if we wrap native iostreams and use namepace other than std::) */#  if defined (_STLP_WHOLE_NATIVE_STD)#    define  _STLP_IMPORT_VENDOR_STD 1#  endif/* if using stlport:: namespace or if C library stuff is not in vendor's std::, * try importing 'em. * MSVC has ambiguity problem when we try to import C-style std:: stuff back into global namespace */#  if defined (_STLP_USE_NAMESPACES) && (defined(_STLP_USE_OWN_NAMESPACE) || defined (_STLP_VENDOR_GLOBAL_CSTD))#    define  _STLP_IMPORT_VENDOR_CSTD 1#  endif#  if defined (_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS) && !defined (_STLP_DO_IMPORT_CSTD_FUNCTIONS)#    define _STLP_NO_CSTD_FUNCTION_IMPORTS#  endif#  define _STLP_USING_NAMESPACE(x) using namespace x ;namespace std { }namespace __std_alias = std;/* assume std:: namespace for C++ std library if not being told otherwise */#  if defined (_STLP_VENDOR_GLOBAL_STD)#    define _STLP_VENDOR_STD#  else#    define _STLP_VENDOR_STD std#  endif/* tune things that come from C library */#  if  defined (_STLP_VENDOR_GLOBAL_CSTD) || !defined(_STLP_USE_NEW_C_HEADERS)/*  in old-style headers, C functions go to global scope. */#    define _STLP_VENDOR_CSTD#    define _STLP_USING_VENDOR_CSTD#  else#    define _STLP_VENDOR_CSTD  _STLP_VENDOR_STD#    define _STLP_USING_VENDOR_CSTD _STLP_USING_NAMESPACE(_STLP_VENDOR_CSTD)#  endif /* _STLP_VENDOR_CSTD *//* exception, typeinfo, new - always come from the vendor */#  if !defined (_STLP_VENDOR_EXCEPT_STD)#    if defined (_STLP_VENDOR_GLOBAL_EXCEPT_STD)#      define _STLP_VENDOR_EXCEPT_STD#    else#      define _STLP_VENDOR_EXCEPT_STD _STLP_VENDOR_STD#    endif#  endif#  define _STLP_OLD_IO_NAMESPACE#  if !defined (_STLP_VENDOR_MB_NAMESPACE)#    define _STLP_VENDOR_MB_NAMESPACE _STLP_VENDOR_CSTD#  endif#else/* compiler has no namespace support */#  define _STLP_VENDOR_STD#  define _STLP_VENDOR_CSTD#  define _STLP_USING_NAMESPACE(x)#  define _STLP_USING_VENDOR_CSTD#  define _STLP_VENDOR_EXCEPT_STD#endif#if defined (_STLP_USE_NAMESPACES)#  if defined (_STLP_USE_OWN_NAMESPACE)#    if !defined (_STLP_STD_NAME)#      if !defined (_STLP_DEBUG)#        if !defined (_STLP_USING_CROSS_NATIVE_RUNTIME_LIB)#          ifndef _STLP_THREADS#            define _STLP_STD_NAME  stlpmtx_std#          else#            define _STLP_STD_NAME  stlp_std#          endif#        else#          ifndef _STLP_THREADS#            define _STLP_STD_NAME  stlpxmtx_std#          else#            define _STLP_STD_NAME  stlpx_std#          endif#        endif#      else/* * The STLport debug mode is binary incompatible with the other modes, * lets make it clear on the STLport namespace to generate link errors rather * than runtime ones. */#        if !defined (_STLP_USING_CROSS_NATIVE_RUNTIME_LIB)#          ifndef _STLP_THREADS#            define _STLP_STD_NAME  stlpdmtx_std#          else#            define _STLP_STD_NAME  stlpd_std#          endif#        else#          ifndef _STLP_THREADS#            define _STLP_STD_NAME  stlpdxmtx_std#          else#            define _STLP_STD_NAME  stlpdx_std#          endif#        endif#      endif#    endifnamespace _STLP_STD_NAME { }#  else#    define _STLP_STD_NAME std#  endif /* _STLP_USE_OWN_NAMESPACE */#  define _STLP_BEGIN_NAMESPACE namespace _STLP_STD_NAME {#  define _STLP_BEGIN_TR1_NAMESPACE namespace tr1 {#  define _STLP_END_NAMESPACE }/* decide whether or not we use separate namespace for rel ops */#  if defined (_STLP_NO_RELOPS_NAMESPACE)#    define _STLP_BEGIN_RELOPS_NAMESPACE _STLP_BEGIN_NAMESPACE namespace rel_ops {}#    define _STLP_END_RELOPS_NAMESPACE }#  else/* Use std::rel_ops namespace */#    define _STLP_BEGIN_RELOPS_NAMESPACE _STLP_BEGIN_NAMESPACE namespace rel_ops {#    define _STLP_END_RELOPS_NAMESPACE } }#    define _STLP_USE_SEPARATE_RELOPS_NAMESPACE#  endif /* Use std::rel_ops namespace */#  define _STLP_STD ::_STLP_STD_NAME#  if !defined (_STLP_TR1)#    define _STLP_TR1 _STLP_STD::tr1::#  endif#  if !defined (_STLP_DONT_USE_PRIV_NAMESPACE)#    define _STLP_PRIV_NAME priv#    define _STLP_PRIV _STLP_STD::_STLP_PRIV_NAME::#    define _STLP_MOVE_TO_PRIV_NAMESPACE namespace _STLP_PRIV_NAME {#    define _STLP_MOVE_TO_STD_NAMESPACE }#  else#      if !defined (_STLP_PRIV)#        define _STLP_PRIV _STLP_STD::#      endif#    define _STLP_MOVE_TO_PRIV_NAMESPACE#    define _STLP_MOVE_TO_STD_NAMESPACE#  endif/* Official STLport namespace when std is not redefined. * Here we don't use a macro because we do not need it and because * stlport is used as file name by boost and folder name under beos: */namespace stlport = _STLP_STD_NAME;/* Backward compatibility: */namespace _STL = _STLP_STD_NAME;#undef __STLPORT_NAMESPACE#define __STLPORT_NAMESPACE _STLP_STD_NAME#else /* _STLP_USE_NAMESPACES *//* STLport is being put into global namespace */#  define _STLP_STD#  define _STLP_PRIV#  define _STLP_TR1#  define _STLP_BEGIN_NAMESPACE#  define _STLP_BEGIN_TR1_NAMESPACE#  define _STLP_END_NAMESPACE#  define _STLP_MOVE_TO_PRIV_NAMESPACE#  define _STLP_MOVE_TO_STD_NAMESPACE/* boris : it was found out that _STLP_USE_SEPARATE_RELOPS_NAMESPACE   causes less problems than having relational operator templates in global namespace   Please define _STLP_NO_RELOPS_NAMESPACE in config/user_config.h if your code rely on them. */#  if !defined (_STLP_NO_RELOPS_NAMESPACE)#    define _STLP_USE_SEPARATE_RELOPS_NAMESPACE#  endif#  define _STLP_BEGIN_RELOPS_NAMESPACE#  define _STLP_END_RELOPS_NAMESPACE#  undef  _STLP_USE_OWN_NAMESPACE#endif  /* _STLP_USE_NAMESPACES */#define STLPORT_CSTD _STLP_VENDOR_CSTD#define STLPORT      _STLP_STD_NAME#if defined(_STLP_BOGUS_TEMPLATE_TYPE_MATCHING_BUG)#  define _STLP_SIMPLE_TYPE(T) _stl_trivial_proxy<T>#else#  define _STLP_SIMPLE_TYPE(T) T#endif#ifndef _STLP_RAND48#  define _STLP_NO_DRAND48#endif/* advanced keywords usage */#define __C_CAST(__x, __y) ((__x)(__y))#ifndef  _STLP_NO_NEW_STYLE_CASTS#  define __CONST_CAST(__x,__y) const_cast<__x>(__y)#  define __STATIC_CAST(__x,__y) static_cast<__x>(__y)#  define __REINTERPRET_CAST(__x,__y) reinterpret_cast<__x>(__y)#else#  define __STATIC_CAST(__x,__y) __C_CAST(__x, __y)#  define __CONST_CAST(__x,__y) __C_CAST(__x, __y)#  define __REINTERPRET_CAST(__x,__y) __C_CAST(__x, __y)#endif#if defined (_STLP_NEED_TYPENAME) && ! defined (typename)#  define typename#endif#if defined (_STLP_NEED_TYPENAME) || defined (_STLP_NO_TYPENAME_ON_RETURN_TYPE )#  define _STLP_TYPENAME_ON_RETURN_TYPE#else#  define _STLP_TYPENAME_ON_RETURN_TYPE typename#endif#ifdef _STLP_NO_TYPENAME_IN_TEMPLATE_HEADER#  define _STLP_HEADER_TYPENAME#else#  define _STLP_HEADER_TYPENAME typename#endif#ifdef _STLP_NO_TYPENAME_BEFORE_NAMESPACE#  define _STLP_TYPENAME#else#  define _STLP_TYPENAME typename#endif#ifndef _STLP_NO_MEMBER_TEMPLATE_KEYWORD#  define _STLP_TEMPLATE template#else#  define _STLP_TEMPLATE#endif#if defined (_STLP_USE_CONTAINERS_EXTENSION)#  define _STLP_KEY_TYPE_FOR_CONT_EXT(type)#  define _STLP_TEMPLATE_FOR_CONT_EXT template <class _KT>#else#  define _STLP_KEY_TYPE_FOR_CONT_EXT(type) typedef type _KT;#  define _STLP_TEMPLATE_FOR_CONT_EXT#endif#if defined (_STLP_NEED_EXPLICIT) && !defined (explicit)#  define explicit#endif#if !defined (_STLP_NEED_MUTABLE)#  define _STLP_MUTABLE(type, x) x#else#  define _STLP_MUTABLE(type, x) __CONST_CAST(type*, this)->x#  define mutable#endif#if defined (_STLP_NO_SIGNED_BUILTINS)/* old HP-UX doesn't understand "signed" keyword */#  define signed#endif#if defined (_STLP_LOOP_INLINE_PROBLEMS)#  define _STLP_INLINE_LOOP#else#  define _STLP_INLINE_LOOP inline#endif#ifndef _STLP_NO_PARTIAL_SPECIALIZATION_SYNTAX#  define _STLP_TEMPLATE_NULL template<>#else#  define _STLP_TEMPLATE_NULL#endif#ifdef _STLP_FUNCTION_TMPL_PARTIAL_ORDER#  define _STLP_OPERATOR_TEMPLATE#else#  define _STLP_OPERATOR_TEMPLATE _STLP_TEMPLATE_NULL#endif#ifndef _STLP_CLASS_PARTIAL_SPECIALIZATION/* unless we have other compiler problem, try simulating partial spec here */#  if !defined (_STLP_DONT_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS)#    define _STLP_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS#  endif/* For your own iterators, please use inheritance from iterator<> instead of these obsolete queries. */#  if  (defined (_STLP_NESTED_TYPE_PARAM_BUG) || !defined (_STLP_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS))#    if ! defined ( _STLP_USE_OLD_HP_ITERATOR_QUERIES )#      define _STLP_USE_OLD_HP_ITERATOR_QUERIES#    endif#  elif defined ( _STLP_NO_ANACHRONISMS )#    undef _STLP_USE_OLD_HP_ITERATOR_QUERIES#  endif#endif#ifndef _STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS#  define _STLP_NULL_TMPL_ARGS <># else#  define _STLP_NULL_TMPL_ARGS#endif#if !defined (_STLP_ALLOCATOR_TYPE_DFL)#  if defined (_STLP_DONT_SUP_DFLT_PARAM)#    define _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS#  endif#  if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)#    define _STLP_ALLOCATOR_TYPE_DFL#  else#    define _STLP_ALLOCATOR_TYPE_DFL = allocator_type()#  endif#endif/* When the compiler do not correctly initialized the basic types value in default parameters we prefer * to avoid them to be able to correct this bug. */#if defined (_STLP_DEF_CONST_DEF_PARAM_BUG)#  define _STLP_DONT_SUP_DFLT_PARAM 1#endif#if defined (__SGI_STL_NO_ARROW_OPERATOR) && ! defined (_STLP_NO_ARROW_OPERATOR)#  define _STLP_NO_ARROW_OPERATOR#endif#if !defined (_STLP_CLASS_PARTIAL_SPECIALIZATION)#  if !(defined (_STLP_NO_ARROW_OPERATOR)) && \       !defined (_STLP_NO_MSVC50_COMPATIBILITY) && !defined (_STLP_MSVC50_COMPATIBILITY)/* this one is needed for proper reverse_iterator<> operator ->() handling */#    define _STLP_MSVC50_COMPATIBILITY 1#  endif#endif#if defined ( _STLP_CLASS_PARTIAL_SPECIALIZATION )#  if (defined(__IBMCPP__) && (500 <= __IBMCPP__) && (__IBMCPP__ < 600) )#    define _STLP_DECLARE_REVERSE_ITERATORS(__reverse_iterator) \   typedef typename _STLP_STD :: reverse_iterator<const_iterator> const_reverse_iterator; \   typedef typename _STLP_STD :: reverse_iterator<iterator> reverse_iterator#  elif (defined (__sgi) && ! defined (__GNUC__)) || defined (__SUNPRO_CC) || defined (__xlC__)#    define _STLP_DECLARE_REVERSE_ITERATORS(__reverse_iterator) \   typedef _STLP_STD:: _STLP_TEMPLATE reverse_iterator<const_iterator> const_reverse_iterator; \   typedef _STLP_STD:: _STLP_TEMPLATE reverse_iterator<iterator> reverse_iterator

⌨️ 快捷键说明

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