This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[V3 PATCH] moving STL config macros



As discussed on the libstdc++ list, this cuts us down from two different
config headers to just one.  The number of macros is still way out there,
but that's a future patch.

Applied to mainline.  Rebuilt files not shown here.



2001-02-20  Phil Edwards  <pme@sources.redhat.com>

	* include/bits/stl_config.h:  Remove file.
	* src/Makefile.am (base_headers):  Remove from list.
	* configure:  Regenerate.
	* Makefile.in:  Ditto.
	* libio/Makefile.in:  Ditto.
	* libmath/Makefile.in:  Ditto.
	* libsupc++/Makefile.in:  Ditto.
	* src/Makefile.in:  Ditto.

	* include/bits/c++config:  Move relevant macros to here.
	* include/backward/alloc.h:  Include c++config.h instead.
	* include/backward/function.h:  Ditto.
	* include/backward/heap.h:  Ditto.
	* include/backward/pair.h:  Ditto.
	* include/bits/pthread_allocimpl.h:  Ditto.
	* include/bits/std_functional.h:  Ditto.
	* include/bits/std_iterator.h:  Ditto.
	* include/bits/std_numeric.h:  Ditto.
	* include/bits/std_utility.h:  Ditto.
	* include/bits/stl_algobase.h:  Ditto.
	* include/bits/type_traits.h:  Ditto.
	* src/stl-inst.cc:  Ditto.


Index: include/backward/alloc.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/backward/alloc.h,v
retrieving revision 1.1
diff -u -3 -p -r1.1 alloc.h
--- alloc.h	2000/10/05 11:27:00	1.1
+++ alloc.h	2001/02/20 20:14:56
@@ -14,9 +14,7 @@
 #ifndef _CPP_BACKWARD_ALLOC_H
 #define _CPP_BACKWARD_ALLOC_H 1
 
-#ifndef _CPP_BITS_STL_CONFIG_H
-#include <bits/stl_config.h>
-#endif
+#include <bits/c++config.h>
 #ifndef _CPP_BITS_STL_ALLOC_H
 #include <bits/stl_alloc.h>
 #endif
Index: include/backward/function.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/backward/function.h,v
retrieving revision 1.2
diff -u -3 -p -r1.2 function.h
--- function.h	2001/02/13 16:09:05	1.2
+++ function.h	2001/02/20 20:14:56
@@ -27,9 +27,7 @@
 #ifndef _CPP_BACKWARD_FUNCTION_H
 #define _CPP_BACKWARD_FUNCTION_H 1
 
-#ifndef _CPP_BITS_STL_CONFIG_H
-#include <bits/stl_config.h>
-#endif
+#include <bits/c++config.h>
 #include <stddef.h>
 #ifndef _CPP_BITS_STL_FUNCTION_H
 #include <bits/stl_function.h>
Index: include/backward/heap.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/backward/heap.h,v
retrieving revision 1.1
diff -u -3 -p -r1.1 heap.h
--- heap.h	2000/10/05 11:27:00	1.1
+++ heap.h	2001/02/20 20:14:56
@@ -26,7 +26,7 @@
 #ifndef _CPP_BACKWARD_HEAP_H
 #define _CPP_BACKWARD_HEAP_H 1
 
-#include <bits/stl_config.h>
+#include <bits/c++config.h>
 #include <bits/stl_heap.h>
 
 #ifdef __STL_USE_NAMESPACES
Index: include/backward/pair.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/backward/pair.h,v
retrieving revision 1.2
diff -u -3 -p -r1.2 pair.h
--- pair.h	2001/02/13 16:09:05	1.2
+++ pair.h	2001/02/20 20:14:56
@@ -27,9 +27,7 @@
 #ifndef _CPP_BACKWARD_PAIR_H
 #define _CPP_BACKWARD_PAIR_H 1
 
-#ifndef _CPP_BITS_STL_CONFIG_H
-#include <bits/stl_config.h>
-#endif
+#include <bits/c++config.h>
 #ifndef _CPP_BITS_STL_PAIR_H
 #include <bits/stl_pair.h>
 #endif
Index: include/bits/c++config
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/c++config,v
retrieving revision 1.11
diff -u -3 -p -r1.11 c++config
--- c++config	2001/02/16 05:39:47	1.11
+++ c++config	2001/02/20 20:14:56
@@ -56,12 +56,117 @@
 # define _GLIBCPP_RESOLVE_LIB_DEFECTS 1
 
 
+// From SGI's stl_config.h; generic settings and user hooks (_NOTHREADS).
+#if defined(_PTHREADS) && !defined(_NOTHREADS)
+#    define __STL_PTHREADS
+#endif
+#if defined(_UITHREADS) && !defined(_PTHREADS) && !defined(_NOTHREADS)
+#    define __STL_UITHREADS
+#endif
+
+// Also from SGI's stl_config.h; settings for GCC.
+#define __STL_HAS_WCHAR_T
+#define __STL_MEMBER_TEMPLATES
+#define __STL_MEMBER_TEMPLATE_CLASSES
+#define __STL_TEMPLATE_FRIENDS
+#define __STL_CLASS_PARTIAL_SPECIALIZATION 
+#define __STL_PARTIAL_SPECIALIZATION_SYNTAX 
+#define __STL_FUNCTION_TMPL_PARTIAL_ORDER
+#define __STL_EXPLICIT_FUNCTION_TMPL_ARGS
+#define __SGI_STL_USE_AUTO_PTR_CONVERSIONS
+#define __STL_HAS_NAMESPACES
+#define __STL_USE_NAMESPACES
+#ifdef __EXCEPTIONS
+#  define __STL_USE_EXCEPTIONS
+#  define __STL_TRY try
+#  define __STL_CATCH_ALL catch(...)
+#  define __STL_THROW(x) throw x
+#  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_THROW(x) 
+#  define __STL_RETHROW 
+#  define __STL_NOTHROW 
+#  define __STL_UNWIND(action) 
+#endif
+#define __STL_THROW_RANGE_ERRORS 
+#define __STL_CAN_THROW_RANGE_ERRORS 
+#define __STL_USE_STD_ALLOCATORS 
+#define __USE_MALLOC // As the "underlying allocator"
+//#define __STL_USE_NEW_IOSTREAMS //990209 bkoz--use standard .h includes.
+#ifdef _REENTRANT
+#  define __STL_THREADS
+#endif
+#ifdef _PTHREADS
+#  define __STL_PTHREADS
+#endif
+#ifndef __STRICT_ANSI__
+#  define __STL_LONG_LONG
+#endif
+//#if (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95)
+#  define __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE
+//#endif
+
+// Also from SGI's stl_config.h; settings for GCC.
+// Mingw32, GCC compiler using the Microsoft C runtime
+#if defined(__MINGW32__)
+#  define __STL_NO_DRAND48
+#  ifdef _MT
+#    define __STL_WIN32THREADS
+#  endif
+#endif
+
+// Cygwin32, GCC compiler on MS Windows
+#if defined(__CYGWIN__)
+#  define __STL_NO_DRAND48
+#endif
+
+// The old stl_config.h would use the above settings in chains of
+// if/then/else tests to define the following.
+#define __STL_DEPENDENT_DEFAULT_TMPL(_Tp) = _Tp
+#define __STL_TEMPLATE
+#define __STL_NULL_TMPL_ARGS <>
+#define __STL_TEMPLATE_NULL template<>
+#define __STL_DEFAULT_ALLOCATOR(T) allocator< T >
+
+#define __STL_USE_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 { namespace rel_ops {
+#define __STL_END_RELOPS_NAMESPACE } }
+#define __STD_RELOPS std::rel_ops
+#define __STD_QUALIFIER std::
+
+
+#ifdef __STL_ASSERTIONS
+# include <stdio.h>
+# define __stl_assert(expr) \
+    if (!(expr)) { fprintf(stderr, "%s:%d STL assertion failure: %s\n", \
+                          __FILE__, __LINE__, # expr); abort(); }
+#else
+# define __stl_assert(expr)
+#endif
+
+#if defined(__STL_WIN32THREADS) || defined(__STL_SGI_THREADS) \
+    || defined(__STL_PTHREADS)  || defined(__STL_UITHREADS)
+#   define __STL_THREADS
+#   define __STL_VOLATILE volatile
+#else
+#   define __STL_VOLATILE
+#endif
+
+#if defined(__STL_CLASS_PARTIAL_SPECIALIZATION) \
+    && defined(__STL_MEMBER_TEMPLATES) \
+    && !defined(_STL_NO_CONCEPT_CHECKS)
+#  define __STL_USE_CONCEPT_CHECKS
+#endif
 
 
-
-
-
-
-
+// End of prewritten config; the discovered settings follow.
 
 
Index: include/bits/pthread_allocimpl.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/pthread_allocimpl.h,v
retrieving revision 1.2
diff -u -3 -p -r1.2 pthread_allocimpl.h
--- pthread_allocimpl.h	2000/10/10 23:50:38	1.2
+++ pthread_allocimpl.h	2001/02/20 20:14:56
@@ -27,8 +27,8 @@
 // cache lines among processors, with potentially serious performance
 // consequences.
 
+#include <bits/c++config.h>
 #include <bits/std_cerrno.h>
-#include <bits/stl_config.h>
 #include <bits/stl_alloc.h>
 #ifndef __RESTRICT
 #  define __RESTRICT
Index: include/bits/std_functional.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_functional.h,v
retrieving revision 1.2
diff -u -3 -p -r1.2 std_functional.h
--- std_functional.h	2001/02/19 18:52:25	1.2
+++ std_functional.h	2001/02/20 20:14:56
@@ -16,8 +16,7 @@
 #define _CPP_FUNCTIONAL 1
 
 #pragma GCC system_header
-
-#include <bits/stl_config.h>
+#include <bits/c++config.h>
 #include <bits/std_cstddef.h>
 #include <bits/stl_function.h>
 
Index: include/bits/std_iterator.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_iterator.h,v
retrieving revision 1.3
diff -u -3 -p -r1.3 std_iterator.h
--- std_iterator.h	2001/02/19 18:52:25	1.3
+++ std_iterator.h	2001/02/20 20:14:56
@@ -28,8 +28,7 @@
 #define _CPP_ITERATOR 1
 
 #pragma GCC system_header
-
-#include <bits/stl_config.h>
+#include <bits/c++config.h>
 #include <bits/std_cstddef.h>
 #include <bits/std_iosfwd.h>
 #include <bits/stl_iterator_base.h>
Index: include/bits/std_numeric.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_numeric.h,v
retrieving revision 1.3
diff -u -3 -p -r1.3 std_numeric.h
--- std_numeric.h	2001/02/19 18:52:25	1.3
+++ std_numeric.h	2001/02/20 20:14:56
@@ -28,8 +28,7 @@
 #define _CPP_NUMERIC 1
 
 #pragma GCC system_header
-
-#include <bits/stl_config.h>
+#include <bits/c++config.h>
 #include <bits/std_cstddef.h>
 #include <bits/std_iterator.h>
 #include <bits/stl_function.h>
Index: include/bits/std_utility.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/std_utility.h,v
retrieving revision 1.2
diff -u -3 -p -r1.2 std_utility.h
--- std_utility.h	2001/02/19 18:52:25	1.2
+++ std_utility.h	2001/02/20 20:14:56
@@ -28,8 +28,7 @@
 #define _CPP_UTILITY 1
 
 #pragma GCC system_header
-
-#include <bits/stl_config.h>
+#include <bits/c++config.h>
 #include <bits/stl_relops.h>
 #include <bits/stl_pair.h>
 
Index: include/bits/stl_algobase.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/stl_algobase.h,v
retrieving revision 1.3
diff -u -3 -p -r1.3 stl_algobase.h
--- stl_algobase.h	2001/01/25 15:35:10	1.3
+++ stl_algobase.h	2001/02/20 20:14:57
@@ -32,7 +32,7 @@
 #ifndef __SGI_STL_INTERNAL_ALGOBASE_H
 #define __SGI_STL_INTERNAL_ALGOBASE_H
 
-#include <bits/stl_config.h>
+#include <bits/c++config.h>
 #ifndef __SGI_STL_INTERNAL_PAIR_H
 #include <bits/stl_pair.h>
 #endif
cvs server: include/bits/stl_config.h was removed, no comparison available
Index: include/bits/type_traits.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/type_traits.h,v
retrieving revision 1.2
diff -u -3 -p -r1.2 type_traits.h
--- type_traits.h	2001/02/19 18:52:25	1.2
+++ type_traits.h	2001/02/20 20:14:57
@@ -17,9 +17,7 @@
 
 #pragma GCC system_header
 
-#ifndef _CPP_BITS_STL_CONFIG_H
-#include <bits/stl_config.h>
-#endif
+#include <bits/c++config.h>
 
 /*
 This header file provides a framework for allowing compile time dispatch
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.72
diff -u -3 -p -r1.72 Makefile.am
--- Makefile.am	2001/02/16 00:43:41	1.72
+++ Makefile.am	2001/02/20 20:14:57
@@ -98,7 +98,7 @@ base_headers = \
 	bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
 	bits/type_traits.h bits/std_algorithm.h \
 	bits/concept_checks.h bits/container_concepts.h \
-	bits/sequence_concepts.h bits/stl_config.h bits/stl_construct.h
+	bits/sequence_concepts.h bits/stl_construct.h
 
 backward_headers = \
 	backward/complex.h backward/iomanip.h backward/istream.h \
Index: src/stl-inst.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/stl-inst.cc,v
retrieving revision 1.3
diff -u -3 -p -r1.3 stl-inst.cc
--- stl-inst.cc	2000/07/22 01:27:10	1.3
+++ stl-inst.cc	2001/02/20 20:14:57
@@ -32,7 +32,6 @@
 //
 
 #include <bits/c++config.h>
-#include <bits/stl_config.h>
 #include <bits/stl_alloc.h>
 #include <bits/std_vector.h>
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]