Shadow headers would work if libsupc++ was strict about namespaces.

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
This commit is contained in:
Benjamin Kosnik 2000-10-17 08:25:08 +00:00
parent 030d2f3414
commit 9ece379a8a
10 changed files with 62 additions and 46 deletions

View 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.

View File

@ -121,4 +121,4 @@ AM_MAKEFLAGS = \
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)"
"WERROR=$(WERROR)"

View 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_ */

View File

@ -32,7 +32,7 @@
//
#ifndef _CPP_CLIMITS
#define _CPP_CLIMTIS 1
#define _CPP_CLIMITS 1
namespace _C_legacy {
extern "C" {

View 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

View File

@ -45,35 +45,3 @@ namespace _C_legacy {
# undef _IN_C_LEGACY_
#endif

View 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_

View File

@ -43,14 +43,28 @@
// 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;

View 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.

View File

@ -23,11 +23,7 @@
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