diff options
Diffstat (limited to 'misc/sys')
-rw-r--r-- | misc/sys/cdefs.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index ff9a891..72dbfde 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992,93,94,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1992-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -85,6 +85,31 @@ #endif +/* The standard library needs the functions from the ISO C90 standard + in the std namespace. At the same time we want to be safe for + future changes and we include the ISO C99 code in the non-standard + namespace __c99. The C++ wrapper header take case of adding the + definitions to the global namespace. */ +#if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES +# define __BEGIN_NAMESPACE_STD namespace std { +# define __END_NAMESPACE_STD } +# define __USING_NAMESPACE_STD(name) using std::name; +# define __BEGIN_NAMESPACE_C99 namespace __c99 { +# define __END_NAMESPACE_C99 } +# define __USING_NAMESPACE_C99(name) using __c99::name; +#else +/* For compatibility we do not add the declarations into any + namespace. They will end up in the global namespace which is what + old code expects. */ +# define __BEGIN_NAMESPACE_STD +# define __END_NAMESPACE_STD +# define __USING_NAMESPACE_STD(name) +# define __BEGIN_NAMESPACE_C99 +# define __END_NAMESPACE_C99 +# define __USING_NAMESPACE_C99(name) +#endif + + /* Support for bounded pointers. */ #ifndef __BOUNDED_POINTERS__ # define __bounded /* nothing */ |