Shadow headers would work if libsupc++ was strict about namespaces.
authorBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 17 Oct 2000 08:25:08 +0000 (08:25 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 17 Oct 2000 08:25:08 +0000 (08:25 +0000)
2000-10-16  Benjamin Kosnik  <bkoz@gnu.org>

Shadow headers would work if libsupc++ was strict about namespaces.
This only possible if g++ maps std::size_t -> size_t. (Hint hint.)
* include/c_std/assert.h: Add guards.
* include/c_std/bits/std_climits.h: Correct typo.
* include/c_std/ctype.h: Remove #error.

* libio/libioP.h: Break up extern "C" bits around includes.
* libio/libio.h: Only include C headers, or else _C_legacy namespaces
will be nested.
* libio/libioP.h: Same here.

From-SVN: r36900

libstdc++-v3/ChangeLog
libstdc++-v3/Makefile.am
libstdc++-v3/include/c_std/assert.h
libstdc++-v3/include/c_std/bits/std_climits.h
libstdc++-v3/include/c_std/bits/std_cstddef.h
libstdc++-v3/include/c_std/bits/wrap_unistd.h
libstdc++-v3/include/c_std/ctype.h
libstdc++-v3/include/c_std/unistd.h
libstdc++-v3/libio/ChangeLog
libstdc++-v3/libio/libioP.h

index 1dd57c1f9accceef77911762fb674319cf67f515..95320e43efa2b67a52ed8bd2f2170f215976bb99 100644 (file)
@@ -1,3 +1,24 @@
+2000-10-16  Benjamin Kosnik  <bkoz@gnu.org>
+
+       Shadow headers would work if libsupc++ was strict about namespaces.
+       This only possible if g++ maps std::size_t -> size_t. (Hint hint.)
+       * include/c_std/assert.h: Add guards.
+       * include/c_std/bits/std_climits.h: Correct typo.
+       * include/c_std/ctype.h: Remove #error.
+
+       * libio/libioP.h: Break up extern "C" bits around includes.
+       * libio/libio.h: Only include C headers, or else _C_legacy namespaces
+       will be nested.
+       * libio/libioP.h: Same here.
+
+2000-10-15 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
+
+       * include/c_std/unistd.h: Define some types only when defined in
+       the original unistd.h.
+       * include/c_std/bits/std_cstddef.h: Explicitly ask for the
+       definition of size_t, ptrdiff_t and NULL.
+       * include/c_std/bits/wrap_unistd.h: Blank lines removal.
+
 2000-10-15  Phil Edwards  <pme@sources.redhat.com>
 
        * docs/configopts.html:  Remove libgcc-rebuild; HTML formatting.
index b32a151cd8b46f84e3989d8ca8f31f9263222c77..0c5c09f2b549a51af3a58962895f9ee2a79e8d2c 100644 (file)
@@ -121,4 +121,4 @@ AM_MAKEFLAGS = \
        "NM_FOR_BUILD=$(NM_FOR_BUILD)" \
        "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
        "DESTDIR=$(DESTDIR)" \
-       "WERROR=$(WERROR)" 
\ No newline at end of file
+       "WERROR=$(WERROR)" 
index 3507bdf449a5663a590fbc79f4fc1b488effa0a5..f4f8d6ebdca1407b4dc4ff5ad3a236760c792094 100644 (file)
@@ -28,7 +28,9 @@
 // the GNU General Public License.
 
 
-// no include guard here.
+#ifndef  _INCLUDED_CPP_ASSERT_H_
+# define _INCLUDED_CPP_ASSERT_H_ 1
+
 #ifdef _IN_C_LEGACY_  /* sub-included by a C header */
       // get out of the "legacy"
     } // close extern "C"
@@ -49,3 +51,5 @@
 # define _IN_C_LEGACY_
 # undef _ASSERT_NEED_C_LEGACY_
 #endif /* _ASSERT_NEED_C_LEGACY_ */
+#endif /* _INCLUDED_CPP_ASSERT_H_ */
+
index d0db90521b062618c2db95f98b64db61815662bc..13d30065ab5860bfc470bcb82150c8cc85701f67 100644 (file)
@@ -32,7 +32,7 @@
 //
 
 #ifndef _CPP_CLIMITS
-#define _CPP_CLIMTIS 1
+#define _CPP_CLIMITS 1
 
 namespace _C_legacy {
   extern "C" {
index 5ebcb61c80846b66e942f40fcedccdd6f8597613..588566499b38dd338396d6f7b82429b2a766ad8e 100644 (file)
@@ -38,7 +38,11 @@ namespace _C_legacy {
   extern "C" {
 #     define _IN_C_LEGACY_
 #     pragma GCC system_header
-#     include_next <stddef.h>
+// XXX
+#   define __need_size_t
+#   define __need_ptrdiff_t
+#   define __need_NULL
+#   include_next <stddef.h>
   }
 } // namespace _C_legacy
 
@@ -53,8 +57,3 @@ namespace std {
 # undef _IN_C_LEGACY_
 
 #endif
-
-
-
-
-
index 144a3ea794c15282d13c380563d6d213cf71e416..8e28b698c7218f6fed57ab5d20745c2a769be150 100644 (file)
@@ -45,35 +45,3 @@ namespace _C_legacy {
 # undef _IN_C_LEGACY_
 
 #endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
index 7dcea803ab527ef4d0e9f75e6a1c8a8f1b749fc4..199089c594cc7b5160cc7de2b12774eeb28b6df3 100644 (file)
@@ -33,7 +33,6 @@
 
 # ifdef _IN_C_LEGACY_  /* sub-included by a C header */
       // get out of the "legacy"
-#error ctype.h
     } // close extern "C"
   }   // close namespace _C_legacy::
 #  undef _IN_C_LEGACY_
index 39cfaae642d1bcd3638962eb78da5547cba441a6..e05efe72f57dfd69097c6dc5af5211a1c0430539 100644 (file)
  
   // Expose global C names, including non-standard ones, but shadow
   // some names and types with the std:: C++ version.
+#ifdef __gid_t_defined
   using _C_legacy::gid_t;
+#endif
+#ifdef __uid_t_defined
   using _C_legacy::uid_t;
+#endif
+#ifdef __off_t_defined
   using _C_legacy::off_t;
+#endif
+#ifdef __off64_t_defined
   using _C_legacy::off64_t;
+#endif
+#ifdef __useconds_t_defined
   using _C_legacy::useconds_t;
+#endif
+#ifdef __pid_t_defined
   using _C_legacy::pid_t;
+#endif
   using _C_legacy::intptr_t;
+#ifdef __socklen_t_defined
   using _C_legacy::socklen_t;
+#endif
 
   using _C_legacy::access;
   using _C_legacy::euidaccess;
index 67d758553eb3df01ed858f185ca781630413a9b6..9736beb09d5b2a9eb4efb08b314e199a6ca098f8 100644 (file)
@@ -1,3 +1,10 @@
+2000-10-17  Benjamin Kosnik  <bkoz@gnu.org>
+
+       * libioP.h: Break up extern "C" bits around includes.
+       * libio.h: Only include C headers, or else _C_legacy namespaces
+       will be nested.
+       * libioP.h: Same here.
+       
 2000-10-11  Benjamin Kosnik  <bkoz@gnu.org>
 
        * Makefile.am: Add includes from GLIBCPP_EXPORT_INCLUDES.
index c2bf2c8205f08d2fd70e7143e6e22f766be82e75..598949d8988297a5d6205605679b87b9c0559a1c 100644 (file)
    other reasons why the executable file might be covered by the GNU
    General Public License.  */
 
-#ifdef __cplusplus
-# include <cerrno>
-#else 
 # include <errno.h>
-#endif
 
 #ifndef __set_errno
 # define __set_errno(Val) errno = (Val)
@@ -620,11 +616,19 @@ extern void (*_IO_cleanup_registration_needed) __PMT ((void));
 
 #if _G_HAVE_MMAP
 
+#ifdef __cplusplus
+} 
+#endif
+
 # include <unistd.h>
 # include <fcntl.h>
 # include <sys/mman.h>
 # include <sys/param.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 # if !defined(MAP_ANONYMOUS) && defined(MAP_ANON)
 #  define MAP_ANONYMOUS MAP_ANON
 # endif