summaryrefslogtreecommitdiff
path: root/libstdc++/stl/stl_config.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++/stl/stl_config.h')
-rw-r--r--libstdc++/stl/stl_config.h119
1 files changed, 92 insertions, 27 deletions
diff --git a/libstdc++/stl/stl_config.h b/libstdc++/stl/stl_config.h
index 31e96cf7cd3..c6546667a93 100644
--- a/libstdc++/stl/stl_config.h
+++ b/libstdc++/stl/stl_config.h
@@ -28,35 +28,47 @@
# define __STL_CONFIG_H
// What this file does.
-// (1) Defines bool, true, and false if the compiler doesn't do so already.
-// (2) Defines __STL_NO_DRAND48 if the compiler's standard library does
-// not support the drand48() function.
-// (3) Defines __STL_STATIC_TEMPLATE_MEMBER_BUG if the compiler can't
-// handle static members of template classes.
-// (4) Defines 'typename' as a null macro if the compiler does not support
-// the typename keyword.
-// (5) Defines __STL_CLASS_PARTIAL_SPECIALIZATION if the compiler
-// supports partial specialization of template classes.
-// (6) Defines __STL_MEMBER_TEMPLATES if the compiler supports
-// template members of classes.
-// (7) Defines 'explicit' as a null macro if the compiler does not support
-// the explicit keyword.
-// (8) Defines __STL_LIMITED_DEFAULT_TEMPLATES if the compiler is
-// unable to handle default template parameters that depend on
-// previous template parameters.
-// (9) Defines __STL_NON_TYPE_TMPL_PARAM_BUG if the compiler has
-// trouble performing function template argument deduction for
-// non-type template parameters.
-// (10) Defines __SGI_STL_NO_ARROW_OPERATOR if the compiler is unable
+// (1) Defines bool, true, and false if the compiler doesn't do so already.
+// (2) Defines __STL_NO_DRAND48 if the compiler's standard library does
+// not support the drand48() function.
+// (3) Defines __STL_STATIC_TEMPLATE_MEMBER_BUG if the compiler can't
+// handle static members of template classes.
+// (4) Defines 'typename' as a null macro if the compiler does not support
+// the typename keyword.
+// (5) Defines __STL_CLASS_PARTIAL_SPECIALIZATION if the compiler
+// supports partial specialization of class templates.
+// (6) Defines __STL_FUNCTION_TMPL_PARTIAL_ORDER if the compiler supports
+// partial ordering of function templates (a.k.a partial specialization
+// of function templates.
+// (7) Defines __STL_EXPLICIT_FUNCTION_TMPL_ARGS if the compiler
+// supports calling a function template by providing its template
+// arguments explicitly.
+// (8) Defines __STL_MEMBER_TEMPLATES if the compiler supports
+// template members of classes.
+// (9) Defines 'explicit' as a null macro if the compiler does not support
+// the explicit keyword.
+// (10) Defines __STL_LIMITED_DEFAULT_TEMPLATES if the compiler is
+// unable to handle default template parameters that depend on
+// previous template parameters.
+// (11) Defines __STL_NON_TYPE_TMPL_PARAM_BUG if the compiler has
+// trouble performing function template argument deduction for
+// non-type template parameters.
+// (12) Defines __SGI_STL_NO_ARROW_OPERATOR if the compiler is unable
// to support the -> operator for iterators.
-// (11) Defines __STL_USE_EXCEPTIONS if the compiler (in the current
+// (13) Defines __STL_USE_EXCEPTIONS if the compiler (in the current
// compilation mode) supports exceptions.
-// (12) Defines __STL_SGI_THREADS if this is being compiled on an SGI
+// (14) Define __STL_USE_NAMESPACES if we're putting the STL into a
+// namespace.
+// (15) Defines __STL_SGI_THREADS if this is being compiled on an SGI
// compiler, and if the user hasn't selected pthreads or no threads
// instead.
-// (13) Defines __STL_WIN32THREADS if this is being compiled on a
+// (16) Defines __STL_WIN32THREADS if this is being compiled on a
// WIN32 compiler in multithreaded mode.
-// (14) Defines __stl_assert either as a test or as a null macro,
+// (17) Define namespace-related macros (__STD, __STL_BEGIN_NAMESPACE, etc.)
+// apropriately.
+// (18) Define exception-related macros (__STL_TRY, __STL_UNWIND, etc.)
+// appropriately.
+// (19) Defines __stl_assert either as a test or as a null macro,
// depending on whether or not __STL_ASSERTIONS is defined.
# if defined(__sgi) && !defined(__GNUC__)
@@ -78,6 +90,9 @@
# ifdef __EXCEPTIONS
# define __STL_USE_EXCEPTIONS
# endif
+# if (_COMPILER_VERSION >= 721) && defined(_NAMESPACES)
+# define __STL_USE_NAMESPACES
+# endif
# if !defined(_NOTHREADS) && !defined(_PTHREADS)
# define __STL_SGI_THREADS
# endif
@@ -90,6 +105,8 @@
# define __STL_NEED_EXPLICIT
# else
# define __STL_CLASS_PARTIAL_SPECIALIZATION
+# define __STL_FUNCTION_TMPL_PARTIAL_ORDER
+# define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
# define __STL_MEMBER_TEMPLATES
# endif
# ifdef __EXCEPTIONS
@@ -108,6 +125,7 @@
# define __STL_MEMBER_TEMPLATES
# define __STL_CLASS_PARTIAL_SPECIALIZATION
# define __STL_USE_EXCEPTIONS
+# define __STL_USE_NAMESPACES
# endif
# if defined(_MSC_VER)
@@ -150,17 +168,60 @@
typedef int bool;
# define true 1
# define false 0
-# undef __STL_NEED_BOOL
# endif
# ifdef __STL_NEED_TYPENAME
# define typename
-# undef __STL_NEED_TYPENAME
# endif
# ifdef __STL_NEED_EXPLICIT
# define explicit
-# undef __STL_NEED_EXPLICIT
+# endif
+
+# ifdef __STL_EXPLICIT_FUNCTION_TMPL_ARGS
+# define __STL_NULL_TMPL_ARGS <>
+# else
+# define __STL_NULL_TMPL_ARGS
+# endif
+
+# ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
+# define __STL_TEMPLATE_NULL template<>
+# else
+# define __STL_TEMPLATE_NULL
+# endif
+
+// __STL_NO_NAMESPACES is a hook so that users can disable namespaces
+// without having to edit library headers.
+# if defined(__STL_USE_NAMESPACES) && !defined(__STL_NO_NAMESPACES)
+# define __STD std
+# define __STL_BEGIN_NAMESPACE namespace std {
+# define __STL_END_NAMESPACE }
+# define __STL_USE_NAMESPACE_FOR_RELOPS
+# define __STL_BEGIN_RELOPS_NAMESPACE namespace std {
+# define __STL_END_RELOPS_NAMESPACE }
+# define __STD_RELOPS std
+# else
+# define __STD
+# define __STL_BEGIN_NAMESPACE
+# define __STL_END_NAMESPACE
+# undef __STL_USE_NAMESPACE_FOR_RELOPS
+# define __STL_BEGIN_RELOPS_NAMESPACE
+# define __STL_END_RELOPS_NAMESPACE
+# define __STD_RELOPS
+# endif
+
+# ifdef __STL_USE_EXCEPTIONS
+# define __STL_TRY try
+# define __STL_CATCH_ALL catch(...)
+# define __STL_RETHROW throw
+# define __STL_NOTHROW throw()
+# define __STL_UNWIND(action) catch(...) { action; throw; }
+# else
+# define __STL_TRY
+# define __STL_CATCH_ALL if (false)
+# define __STL_RETHROW
+# define __STL_NOTHROW
+# define __STL_UNWIND(action)
# endif
#ifdef __STL_ASSERTIONS
@@ -173,3 +234,7 @@
#endif
#endif /* __STL_CONFIG_H */
+
+// Local Variables:
+// mode:C++
+// End: