Commit 98e6e789 by Benjamin Kosnik

configure.in: Change GLIBCPP_ENABLE_SHADOW to GLIBCPP_ENABLE_CHEADERS.


2000-12-21  Benjamin Kosnik  <bkoz@redhat.com>

	* configure.in: Change GLIBCPP_ENABLE_SHADOW to
	GLIBCPP_ENABLE_CHEADERS.
	* acinclude.m4 (GLIBCPP_ENABLE_SHADOW): Change to
	ENABLE_CHEADERS.  C_INCLUDE_DIR defaults to c_std from c.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* include/c: Move to ...
	* include/c_std: ...here.
	* include/c_std: Move to ...
	* include/c_shadow: ...here.
	* include/c: Repopulate, with simple headers.
	* docs/html/configopts.html: Adjust docs.

From-SVN: r38440
parent 74da183a
// -*- C++ -*- C math library.
// Copyright (C) 2000 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
// This file was written by Gabriel Dos Reis <gdr@codesourcery.com>
#ifndef _CPP_BITS_CMATH_TCC
#define _CPP_BITS_CMATH_TCC 1
namespace std {
export template<typename _Tp>
_Tp
__cmath_power(_Tp __x, unsigned int __n)
{
_Tp __y = __n % 2 ? __x : 1;
while (__n >>= 1)
{
__x = __x * __x;
if (__n % 2)
__y = __y * __x;
}
return __y;
}
}
#endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,31 +31,19 @@ ...@@ -31,31 +31,19 @@
// ISO C++ 14882: 19.2 Assertions // ISO C++ 14882: 19.2 Assertions
// //
// NB: This is assumed to be a conforming implementation. // Note: This is not a conforming implementation.
// No include guards on this header...
#pragma GCC system_header
#include <assert.h>
// ISO/IEC 9899:1999 (E), section 7.2
// assert.h
// ..defines the assert macro...
// ISO 14882
// 17.4.1.2 Headers
// ... declarations and definitions (except for macros) are within
// namespace scope of the namepace std...
//#ifndef _CPP_CASSERT
//#define _CPP_CASSERT 1
//namespace _C_legacy {
extern "C" {
//# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <assert.h>
}
//} // namespace _C_legacy
//#undef _IN_C_LEGACY_
//#endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -27,118 +27,63 @@ ...@@ -27,118 +27,63 @@
// invalidate any other reasons why the executable file might be covered by // invalidate any other reasons why the executable file might be covered by
// the GNU General Public License. // the GNU General Public License.
// ISO C++ 14882: 22
// //
// ISO C++ 14882: <ccytpe>
//
// Note: This is not a conforming implementation.
#ifndef _CPP_CCTYPE #ifndef _CPP_CCTYPE
#define _CPP_CCTYPE 1 #define _CPP_CCTYPE 1
namespace _C_legacy { #include <bits/c++config.h>
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <ctype.h>
}
inline int
_CPP_isalnum_capture(int c) { return isalnum(c); }
inline int
_CPP_isalpha_capture(int c) { return isalpha(c); }
inline int
_CPP_iscntrl_capture(int c) { return iscntrl(c); }
inline int
_CPP_isdigit_capture(int c) { return isdigit(c); }
inline int
_CPP_isgraph_capture(int c) { return isgraph(c); }
inline int
_CPP_islower_capture(int c) { return islower(c); }
inline int
_CPP_isprint_capture(int c) { return isprint(c); }
inline int
_CPP_ispunct_capture(int c) { return ispunct(c); }
inline int
_CPP_isspace_capture(int c) { return isspace(c); }
inline int
_CPP_isupper_capture(int c) { return isupper(c); }
inline int
_CPP_isxdigit_capture(int c) { return isxdigit(c); }
inline int
_CPP_tolower_capture(int c) { return tolower(c); }
inline int
_CPP_toupper_capture(int c) { return toupper(c); }
} // namespace _C_legacy
# undef isalnum
# undef isalpha
# undef iscntrl
# undef isdigit
# undef isgraph
# undef islower
# undef isprint
# undef ispunct
# undef isspace
# undef isupper
# undef isxdigit
# undef tolower
# undef toupper
namespace std {
inline int
isalnum(int __c) { return _C_legacy::_CPP_isalnum_capture(__c); }
inline int
isalpha(int __c) { return _C_legacy::_CPP_isalpha_capture(__c); }
inline int #pragma GCC system_header
iscntrl(int __c) { return _C_legacy::_CPP_iscntrl_capture(__c); } #include <ctype.h>
inline int // Get rid of those macros defined in <ctype.h> in lieu of real functions.
isdigit(int __c) { return _C_legacy::_CPP_isdigit_capture(__c); } #undef isalnum
#undef isalpha
#undef isblank
#undef iscntrl
#undef isdigit
#undef isgraph
#undef islower
#undef isprint
#undef ispunct
#undef isspace
#undef isupper
#undef isxdigit
#undef tolower
#undef toupper
inline int namespace std
isgraph(int __c) { return _C_legacy::_CPP_isgraph_capture(__c); } {
extern "C" int isalnum(int __c);
extern "C" int isalpha(int __c);
extern "C" int isblank(int __c);
extern "C" int iscntrl(int __c);
extern "C" int isdigit(int __c);
extern "C" int isgraph(int __c);
extern "C" int islower(int __c);
extern "C" int isprint(int __c);
extern "C" int ispunct(int __c);
extern "C" int isspace(int __c);
extern "C" int isupper(int __c);
extern "C" int isxdigit(int __c);
extern "C" int tolower(int __c);
extern "C" int toupper(int __c);
}
inline int #endif
islower(int __c) { return _C_legacy::_CPP_islower_capture(__c); }
inline int
isprint(int __c) { return _C_legacy::_CPP_isprint_capture(__c); }
inline int
ispunct(int __c) { return _C_legacy::_CPP_ispunct_capture(__c); }
inline int
isspace(int __c) { return _C_legacy::_CPP_isspace_capture(__c); }
inline int
isupper(int __c) { return _C_legacy::_CPP_isupper_capture(__c); }
inline int
isxdigit(int __c) { return _C_legacy::_CPP_isxdigit_capture(__c); }
inline int
tolower(int __c) { return _C_legacy::_CPP_tolower_capture(__c); }
inline int
toupper(int __c) { return _C_legacy::_CPP_toupper_capture(__c); }
} // namespace std
# undef _IN_C_LEGACY_
#endif
......
// -*- C++ -*- header wrapper. // The -*- C++ -*- error number header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -27,22 +27,25 @@ ...@@ -27,22 +27,25 @@
// invalidate any other reasons why the executable file might be covered by // invalidate any other reasons why the executable file might be covered by
// the GNU General Public License. // the GNU General Public License.
//
// ISO C++ 14882: 19.3 Error numbers // ISO C++ 14882: 19.3 Error numbers
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CERRNO #ifndef _CPP_CERRNO
#define _CPP_CERRNO 1 #define _CPP_CERRNO 1
//namespace _C_legacy { #pragma GCC system_header
extern "C" { #include <errno.h>
//# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <errno.h>
}
//} // namespace _C_legacy::
//# undef _IN_C_LEGACY_ namespace std
{
extern "C" int errno;
}
#endif #endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,24 +31,13 @@ ...@@ -31,24 +31,13 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library // ISO C++ 14882: 18.2.2 Implementation properties: C library
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CFLOAT #ifndef _CPP_CFLOAT
#define _CPP_CFLOAT 1 #define _CPP_CFLOAT 1
namespace _C_legacy { #pragma GCC system_header
extern "C" { #include <float.h>
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <float.h>
}
} // namespace _C_legacy
# undef _IN_C_LEGACY_
#endif #endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,18 +31,13 @@ ...@@ -31,18 +31,13 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library // ISO C++ 14882: 18.2.2 Implementation properties: C library
// //
#ifndef _CPP_CLIMITS // Note: This is not a conforming implementation.
#define _CPP_CLIMITS 1
namespace _C_legacy { #ifndef _CPP_CLIMITS
extern "C" { #define _CPP_CLIMITS 1
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <limits.h>
}
} // namespace _C_legacy
# undef _IN_C_LEGACY_ #pragma GCC system_header
#include <limits.h>
#endif #endif
...@@ -50,8 +45,3 @@ namespace _C_legacy { ...@@ -50,8 +45,3 @@ namespace _C_legacy {
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,40 +31,22 @@ ...@@ -31,40 +31,22 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library // ISO C++ 14882: 18.2.2 Implementation properties: C library
// //
#ifndef _CPP_CLOCALE // Note: This is not a conforming implementation.
#define _CPP_CLOCALE 1
# include <bits/std_cstddef.h>
namespace _C_legacy {
extern "C" {
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <locale.h>
}
typedef lconv _CPP_lconv_capture;
} // namespace _C_legacy
# undef lconv
# undef setlocale
# undef localeconv
namespace std { #ifndef _CPP_CLOCALE
// Adopt C names into std:: #define _CPP_CLOCALE 1
struct lconv : _C_legacy::_CPP_lconv_capture { };
using _C_legacy::setlocale;
inline lconv*
localeconv() { return reinterpret_cast<lconv*>(_C_legacy::localeconv()); }
} // namespace std
# undef _IN_C_LEGACY_
#endif #pragma GCC system_header
#include <locale.h>
namespace std
{
using ::lconv;
extern "C" char* setlocale(int, const char*);
extern "C" struct lconv* localeconv(void);
}
#endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,33 +31,18 @@ ...@@ -31,33 +31,18 @@
// ISO C++ 14882: 20.4.6 C library // ISO C++ 14882: 20.4.6 C library
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CSETJMP #ifndef _CPP_CSETJMP
#define _CPP_CSETJMP 1 #define _CPP_CSETJMP 1
namespace _C_legacy { #pragma GCC system_header
extern "C" { #include <setjmp.h>
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <setjmp.h>
}
inline int
_CPP_setjmp_capture(jmp_buf __jb) { return setjmp(__jb); }
} // namespace _C_legacy
# undef jmp_buf
# undef setjmp
# define setjmp(__jb) _C_legacy::_CPP_setjmp_capture(__jb)
# undef longjmp
namespace std {
// Adopt C names into std::
using _C_legacy::jmp_buf;
using _C_legacy::longjmp;
} // namespace std
# undef _IN_C_LEGACY_
#endif
namespace std
{
using ::jmp_buf;
extern "C" void longjmp(jmp_buf, int);
}
#endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,37 +31,19 @@ ...@@ -31,37 +31,19 @@
// ISO C++ 14882: 20.4.6 C library // ISO C++ 14882: 20.4.6 C library
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CSIGNAL #ifndef _CPP_CSIGNAL
#define _CPP_CSIGNAL 1 #define _CPP_CSIGNAL 1
namespace _C_legacy { #pragma GCC system_header
extern "C" { #include <signal.h>
# define _IN_C_LEGACY_
// XXX
# undef __need_sig_atomic_t
# undef __need_sigset_t
# pragma GCC system_header
# include_next <signal.h>
}
} // namespace _C_legacy
# undef sig_atomic_t namespace std
# undef raise {
# undef signal using ::sig_atomic_t;
extern "C" void (*signal(int, void (*__func)(int)))(int);
namespace std { extern "C" int raise(int);
// Adopt C names into std:: }
using _C_legacy::sig_atomic_t;
using _C_legacy::raise;
using _C_legacy::signal;
} // namespace std
# undef _IN_C_LEGACY_
#endif #endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,24 +31,17 @@ ...@@ -31,24 +31,17 @@
// ISO C++ 14882: 20.4.6 C library // ISO C++ 14882: 20.4.6 C library
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CSTDARG #ifndef _CPP_CSTDARG
#define _CPP_CSTDARG 1 #define _CPP_CSTDARG 1
namespace _C_legacy { #pragma GCC system_header
extern "C" { #include <stdarg.h>
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <stdarg.h>
}
} // namespace _C_legacy
# undef va_list
namespace std { namespace std
using _C_legacy::va_list; {
} // namespace std using ::va_list;
}
# undef _IN_C_LEGACY_
#endif #endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,29 +31,18 @@ ...@@ -31,29 +31,18 @@
// ISO C++ 14882: 18.1 Types // ISO C++ 14882: 18.1 Types
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CSTDDEF #ifndef _CPP_CSTDDEF
#define _CPP_CSTDDEF 1 #define _CPP_CSTDDEF 1
namespace _C_legacy { #pragma GCC system_header
extern "C" { #include <stddef.h>
# define _IN_C_LEGACY_
# pragma GCC system_header namespace std
// XXX {
# define __need_size_t using ::ptrdiff_t;
# define __need_ptrdiff_t using ::size_t;
# define __need_NULL }
# include_next <stddef.h>
}
} // namespace _C_legacy
# undef ptrdiff_t
# undef size_t
namespace std {
using _C_legacy::ptrdiff_t;
using _C_legacy::size_t;
} // namespace std
# undef _IN_C_LEGACY_
#endif #endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,253 +31,85 @@ ...@@ -31,253 +31,85 @@
// ISO C++ 14882: 27.8.2 C Library files // ISO C++ 14882: 27.8.2 C Library files
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CSTDIO #ifndef _CPP_CSTDIO
#define _CPP_CSTDIO 1 #define _CPP_CSTDIO 1
# include <bits/std_cstddef.h> #include <bits/std_cstdarg.h>
# include <bits/std_cstdarg.h>
#pragma GCC system_header
namespace _C_legacy { #include <stdio.h>
extern "C" {
# define _IN_C_LEGACY_ // Get rid of those macros defined in <stdio.h> in lieu of real functions.
# undef __need_FILE #undef clearerr
# pragma GCC system_header #undef feof
# include_next <stdio.h> #undef ferror
} #undef fileno
#undef getc
typedef FILE _CPP_FILE_capture; #undef getchar
typedef fpos_t _CPP_fpos_t_capture; #undef putc
#undef putchar
inline FILE*
_CPP_stderr_capture() { return stderr; } namespace std
{
inline FILE* using ::FILE;
_CPP_stdin_capture() { return stdin; } using ::fpos_t;
inline FILE* extern "C" int remove(const char*);
_CPP_stdout_capture() { return stdout; } extern "C" int rename(const char*, const char*);
extern "C" FILE* tmpfile(void);
inline int extern "C" char* tmpnam(char*);
_CPP_getc_capture(FILE* __f) { return getc(__f); } extern "C" int fclose(FILE*);
extern "C" int fflush(FILE*);
inline int extern "C" FILE* fopen(const char*, const char*);
_CPP_getchar_capture() { return getchar(); } extern "C" FILE* freopen(const char*, const char*, FILE*);
extern "C" void setbuf(FILE*, char*);
inline int extern "C" int setvbuf(FILE*, char*, int, size_t);
_CPP_putc_capture(int __c, FILE* __f) { return putc(__c, __f); } extern "C" int fprintf(FILE*, const char*, ...);
extern "C" int fscanf(FILE*, const char*, ...);
inline int extern "C" int printf(const char*, ...);
_CPP_putchar_capture(int __c) { return putchar(__c); } extern "C" int scanf(const char*, ...);
extern "C" int snprintf(char *, size_t, const char*, ...);
inline int extern "C" int sprintf(char *, const char*, ...);
_CPP_feof_capture(FILE* __f) { return feof(__f); } extern "C" int sscanf(const char*, const char*, ...);
extern "C" int vfprintf(FILE*, const char*, va_list);
} // namespace _C_legacy extern "C" int vfscanf(FILE*, const char*, va_list);
extern "C" int vprintf(const char*, va_list);
# undef FILE extern "C" int vscanf(const char*, va_list);
# undef fpos_t extern "C" int vsnprintf(char*, size_t, const char*, va_list);
extern "C" int vsprintf(char*, const char*, va_list);
# undef remove extern "C" int vsscanf(const char*, const char*, va_list);
# undef rename extern "C" int fgetc(FILE *);
# undef tmpfile extern "C" char *fgets(char*, int, FILE*);
# undef tmpnam extern "C" int fputc(int, FILE*);
# undef fclose extern "C" int fputs(const char*, FILE*);
# undef fflush extern "C" int getc(FILE*);
# undef fopen extern "C" int getchar(void);
# undef freopen extern "C" char *gets(char*);
# undef setbuf extern "C" int putc(int, FILE*);
# undef setvbuf extern "C" int putchar(int);
# undef fprintf extern "C" int puts(const char*);
# undef fscanf extern "C" int ungetc(int, FILE*);
# undef printf extern "C" size_t fread(void*, size_t, size_t, FILE*);
# undef scanf extern "C" size_t fwrite(const void*, size_t, size_t, FILE*);
# undef sprintf extern "C" int fgetpos(FILE*, fpos_t*);
# undef sscanf extern "C" int fseek(FILE*, long int, int);
# undef vfprintf extern "C" int fsetpos(FILE*, const fpos_t*);
# undef vprintf extern "C" long int ftell(FILE*);
# undef vsprintf extern "C" void rewind(FILE*);
# undef fgetc extern "C" void clearerr(FILE*);
# undef fgets extern "C" int feof(FILE*);
# undef fputc extern "C" int ferror(FILE*);
# undef fputs extern "C" void perror(const char*);
# undef getc }
# undef getchar
# undef gets
# undef putc
# undef putchar
# undef puts
# undef ungetc
# undef fread
# undef fwrite
# undef fgetpos
# undef fseek
# undef fsetpos
# undef ftell
# undef rewind
# undef clearerr
# undef feof
# undef ferror
# undef perror
# undef stderr
# define stderr std::_CPP_stderr()
# undef stdin
# define stdin std::_CPP_stdin()
# undef stdout
# define stdout std::_CPP_stdout()
namespace std {
struct FILE : _C_legacy::_CPP_FILE_capture { };
struct fpos_t { _C_legacy::_CPP_fpos_t_capture _M_dummy; };
using _C_legacy::remove;
using _C_legacy::rename;
using _C_legacy::tmpnam;
using _C_legacy::printf;
using _C_legacy::scanf;
using _C_legacy::sprintf;
using _C_legacy::sscanf;
using _C_legacy::gets;
using _C_legacy::perror;
inline FILE*
_CPP_stderr()
{ return reinterpret_cast<FILE*>(_C_legacy::_CPP_stderr_capture() ); }
inline FILE*
_CPP_stdin()
{ return reinterpret_cast<FILE*>(_C_legacy::_CPP_stdin_capture() ); }
inline FILE*
_CPP_stdout()
{ return reinterpret_cast<FILE*>(_C_legacy::_CPP_stdout_capture() ); }
inline FILE*
tmpfile() { return reinterpret_cast<FILE*>(_C_legacy::tmpfile()); }
inline int
fclose(FILE* __f) { return _C_legacy::fclose(__f); }
inline int
fflush(FILE* __f) { return _C_legacy::fflush(__f); }
inline FILE*
fopen(char const* __name, char const* __mode)
{ return reinterpret_cast<FILE*>(_C_legacy::fopen(__name,__mode)); }
inline FILE*
freopen(char const* __name, char const* __mode, FILE* __f)
{ return reinterpret_cast<FILE*>(_C_legacy::freopen(__name,__mode,__f)); }
inline void
setbuf(FILE* __f, char* __buf)
{ return _C_legacy::setbuf(__f, __buf); }
inline int #endif
setvbuf(FILE* __f, char* __buf, int __mode, size_t __size)
{ return _C_legacy::setvbuf(__f, __buf, __mode, __size); }
inline int
fprintf(FILE* __f, char const* __fmt, ...)
{
va_list __v;
va_start(__v,__fmt);
int __i = _C_legacy::vfprintf(__f, __fmt, __v);
va_end(__v);
return __i;
}
inline int
fscanf(FILE* __f, char const* __fmt, ...)
{
va_list __v;
va_start(__v,__fmt);
int __i = _C_legacy::vfscanf(__f, __fmt, __v);
va_end(__v);
return __i;
}
inline int
vfprintf(FILE* __f, char const* __fmt, va_list __v)
{ return _C_legacy::vfprintf(__f, __fmt, __v); }
inline int
vprintf(char const* __fmt, va_list __v)
{ return _C_legacy::vprintf(__fmt, __v); }
inline int
vsprintf(char* __buf, char const* __fmt, va_list __v)
{ return _C_legacy::vsprintf(__buf, __fmt, __v); }
inline int
fgetc(FILE* __f) { return _C_legacy::fgetc(__f); }
inline char*
fgets(char* __buf, int __n, FILE* __f)
{ return _C_legacy::fgets(__buf, __n, __f); }
inline int
fputc(int __c, FILE* __f) { return _C_legacy::fputc(__c, __f); }
inline int
fputs(char const* __s, FILE* __f)
{ return _C_legacy::fputs(__s, __f); }
inline int
getc(FILE* __f) { return _C_legacy::_CPP_getc_capture(__f); }
inline int
getchar() { return _C_legacy::_CPP_getchar_capture(); }
inline int
putc(int __c, FILE* __f)
{ return _C_legacy::_CPP_putc_capture(__c, __f); }
inline int
putchar(int __c) { return _C_legacy::_CPP_putchar_capture(__c); }
using _C_legacy::puts;
inline int
ungetc(int __c, FILE* __f) { return _C_legacy::ungetc(__c, __f); }
inline size_t
fread(void* __p, size_t __z, size_t __n, FILE* __f)
{ return _C_legacy::fread(__p,__z,__n,__f); }
inline size_t
fwrite(void const* __p, size_t __z, size_t __n, FILE* __f)
{ return _C_legacy::fwrite(__p,__z,__n,__f); }
inline int
fgetpos(FILE* __f, fpos_t* __pos)
{ return _C_legacy::fgetpos(__f,&__pos->_M_dummy); }
inline int
fseek(FILE* __f, long __off, int __how)
{ return _C_legacy::fseek(__f,__off,__how); }
inline int
fsetpos(FILE* __f, fpos_t const* __pos)
{ return _C_legacy::fsetpos(__f,&__pos->_M_dummy); }
inline long
ftell(FILE* __f) { return _C_legacy::ftell(__f); }
inline void
rewind(FILE* __f) { return _C_legacy::rewind(__f); }
inline void
clearerr(FILE* __f) { return _C_legacy::clearerr(__f); }
inline int
feof(FILE* __f) { return _C_legacy::_CPP_feof_capture(__f); }
inline int
ferror(FILE* __f) { return _C_legacy::ferror(__f); }
} // namespace std
# undef _IN_C_LEGACY_
#endif
// -*- C++ -*- header wrapper // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,79 +31,24 @@ ...@@ -31,79 +31,24 @@
// ISO C++ 14882: 20.4.6 C library // ISO C++ 14882: 20.4.6 C library
// //
// Function decls in this header are overloaded on the // Note: This is not a conforming implementation.
// extern "C"-ness of arguments. This is a rich ground
// for compiler bugs.
#ifndef _CPP_CSTDLIB #ifndef _CPP_CSTDLIB
#define _CPP_CSTDLIB 1 #define _CPP_CSTDLIB 1
# include <bits/c++config.h> #include <bits/c++config.h>
# include <bits/std_cstddef.h>
namespace _C_legacy { #pragma GCC system_header
extern "C" { #include <stdlib.h>
# define _IN_C_LEGACY_
# pragma GCC system_header
# include_next <stdlib.h>
typedef int (*_C_cmp_fun_ptr)(const void*, const void*); // C fn ptr
}
typedef div_t _CPP_div_t_capture; namespace std
typedef ldiv_t _CPP_ldiv_t_capture; {
using ::div_t;
# if _GLIBCPP_HAVE_LLDIV_T using ::ldiv_t;
typedef lldiv_t _CPP_lldiv_t_capture;
# endif
} // namespace _C_legacy
# undef wchar_t
# undef div_t
# undef ldiv_t
# undef atof
# undef atoi
# undef atol
# undef strtod
# undef strtol
# undef strtoul
#ifdef _GLIBCPP_HAVE_STRTOLD
# undef strtold
#endif
# undef rand
# undef srand
# undef calloc
# undef free
# undef malloc
# undef realloc
# undef abort
# undef atexit
# undef exit
# undef getenv
# undef system
# undef bsearch
# undef qsort
# undef abs
# undef div
# undef labs
# undef ldiv
#ifdef _GLIBCPP_USE_LONG_LONG
# undef llabs
# undef lldiv
#endif
# undef mblen
# undef mbtowc
# undef wctomb
# undef mbstowcs
# undef wcstombs
namespace std {
struct div_t : _C_legacy::_CPP_div_t_capture { };
struct ldiv_t : _C_legacy::_CPP_ldiv_t_capture { };
#ifdef _GLIBCPP_USE_LONG_LONG #ifdef _GLIBCPP_USE_LONG_LONG
# ifdef _GLIBCPP_HAVE_LLDIV_T # ifdef _GLIBCPP_HAVE_LLDIV_T
struct lldiv_t : _C_legacy::_CPP_lldiv_t_captur { }; using ::lldiv_t;
# else # else
struct lldiv_t struct lldiv_t
{ {
...@@ -111,87 +56,71 @@ namespace std { ...@@ -111,87 +56,71 @@ namespace std {
long long rem; long long rem;
}; };
# endif # endif
#endif #endif
using _C_legacy::atof; extern "C" double atof(const char*);
using _C_legacy::atoi; extern "C" int atoi(const char*);
using _C_legacy::atol; extern "C" long int atol(const char*);
using _C_legacy::strtod; extern "C" double strtod(const char*, char**);
using _C_legacy::strtol; extern "C" float strtof(const char*, char**);
using _C_legacy::strtoul; extern "C" long int strtol(const char*, char**, int);
using _C_legacy::rand; extern "C" unsigned long int strtoul(const char*, char**, int);
using _C_legacy::srand; extern "C" int rand(void);
using _C_legacy::calloc; extern "C" void srand(unsigned int);
using _C_legacy::free; extern "C" void* calloc(size_t, size_t);
using _C_legacy::malloc; extern "C" void free(void*);
using _C_legacy::realloc; extern "C" void* malloc(size_t);
extern "C" void* realloc(void*, size_t);
// using _C_legacy::abort; extern "C" void abort(void);
using _C_legacy::atexit; extern "C" int atexit(void (*func)(void));
// using _C_legacy::exit; extern "C" void exit(int);
using _C_legacy::bsearch; extern "C" void _Exit(int);
using _C_legacy::qsort; extern "C" char*getenv(const char*);
extern "C" int system(const char*);
using _C_legacy::getenv; extern "C" void* bsearch(const void*, const void*, size_t, size_t,
using _C_legacy::system; int (*comp)(const void *, const void *));
using _C_legacy::mbtowc; extern "C" void qsort(void*, size_t, size_t,
using _C_legacy::wctomb; int (*comp)(const void *, const void *));
using _C_legacy::mbstowcs; extern "C" int abs(int);
using _C_legacy::wcstombs; extern "C" long int labs(long int);
extern "C" div_t div(int, int);
using _C_legacy::strtof; extern "C" ldiv_t ldiv(long int, long int);
extern "C" int mblen(const char*, size_t);
#ifdef _GLIBCPP_USE_LONG_LONG extern "C" int mbtowc(wchar_t*, const char*, size_t);
using _C_legacy::strtoll; extern "C" int wctomb(char*, wchar_t);
using _C_legacy::strtoull; extern "C" size_t mbstowcs(wchar_t*, const char*, size_t);
#endif extern "C" size_t wcstombs(char*, const wchar_t*, size_t);
#ifdef _GLIBCPP_HAVE_STRTOLD
using _C_legacy::strtold;
#endif
using _C_legacy::mblen;
inline int
abs(int __x) { return __x >= 0 ? __x : -__x; }
inline div_t
div(int __n, int __d)
{ div_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
inline long
labs(long __x) { return __x >= 0 ? __x : -__x; }
inline long
abs(long __x) { return __x >= 0 ? __x : -__x; }
inline ldiv_t
ldiv(long __n, long __d)
{ ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
inline ldiv_t
div(long __n, long __d)
{ ldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
#ifdef _GLIBCPP_USE_LONG_LONG #ifdef _GLIBCPP_USE_LONG_LONG
inline long long inline long long
llabs(long long __x) { return __x >= 0 ? __x : -__x; } abs(long long __x) { return __x >= 0 ? __x : -__x; }
inline long long inline long long
abs(long long __x) { return __x >= 0 ? __x : -__x; } llabs(long long __x) { return __x >= 0 ? __x : -__x; }
inline lldiv_t inline lldiv_t
lldiv(long long __n, long long __d) div(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
inline lldiv_t inline lldiv_t
div(long long __n, long long __d) lldiv(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
extern "C" long long int atoll(const char*);
extern "C" long long int strtoll(const char*, char**, int);
extern "C" unsigned long long int strtoull(const char*, char**, int);
#endif #endif
} // namespace std
# undef _IN_C_LEGACY_
#ifdef _GLIBCPP_HAVE_STRTOLD
extern "C" long double strtold(const char*, char**);
#endif #endif
}
#endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,249 +31,43 @@ ...@@ -31,249 +31,43 @@
// ISO C++ 14882: 20.4.6 C library // ISO C++ 14882: 20.4.6 C library
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CSTRING #ifndef _CPP_CSTRING
#define _CPP_CSTRING 1 #define _CPP_CSTRING 1
# if defined __GLIBC__ && __GLIBC__ >= 2 #include <bits/c++config.h>
// We must not see the optimized string functions GNU libc defines.
# define __NO_STRING_INLINES #pragma GCC system_header
# endif #include <string.h>
# include <bits/std_cstddef.h> namespace std
{
namespace _C_legacy { extern "C" void* memcpy(void*, const void*, size_t);
extern "C" { extern "C" void* memmove(void*, const void*, size_t);
# define _IN_C_LEGACY_ extern "C" char* strcpy(char*, const char*);
# pragma GCC system_header extern "C" char* strncpy(char*, const char*, size_t);
# include_next <string.h> extern "C" char* strcat(char*, const char*);
} extern "C" char* strncat(char*, const char*, size_t);
extern "C" int memcmp(const void*, const void*, size_t);
// We do inline captures of most of these in case they extern "C" int strcmp(const char*, const char*);
// have been optimized with macros. extern "C" int strcoll(const char*, const char*);
inline void* extern "C" int strncmp(const char*, const char*, size_t);
_CPP_memcpy_capture(void* __s1, void const* __s2, size_t __n) extern "C" size_t strxfrm(char*, const char*, size_t);
{ return memcpy(__s1, __s2, __n); } extern "C" void* memchr(const void*, int, size_t);
extern "C" char* strchr(const char*, int);
inline void* extern "C" size_t strcspn(const char*, const char*);
_CPP_memmove_capture(void* __s1, void const* __s2, size_t __n) extern "C" char* strpbrk(const char*, const char*);
{ return memmove(__s1, __s2, __n); } extern "C" char* strrchr(const char*, int);
extern "C" size_t strspn(const char*, const char*);
inline void* extern "C" char* strstr(const char*, const char*);
_CPP_strcpy_capture(char* __s1, char const* __s2) extern "C" char* strtok(char*, const char*);
{ return strcpy(__s1, __s2); } extern "C" void* memset(void*, int, size_t);
extern "C" char* strerror(int);
inline char* extern "C" size_t strlen(const char*);
_CPP_strncpy_capture(char* __s1, char const* __s2, size_t __n) }
{ return strncpy(__s1, __s2, __n); }
inline char*
_CPP_strcat_capture(char* __s1, char const* __s2)
{ return strcat(__s1, __s2); }
inline char*
_CPP_strncat_capture(char* __s1, char const* __s2, size_t __n)
{ return strncat(__s1, __s2, __n); }
inline int
_CPP_memcmp_capture(void const* __s1, void const* __s2, size_t __n)
{ return memcmp(__s1, __s2, __n); }
inline int
_CPP_strcmp_capture(char const* __s1, char const* __s2)
{ return strcmp(__s1, __s2); }
inline int
_CPP_strcoll_capture(char const* __s1, char const* __s2)
{ return strcoll(__s1, __s2); }
inline int
_CPP_strncmp_capture(char const* __s1, char const* __s2, size_t __n)
{ return strncmp(__s1, __s2, __n); }
inline size_t
_CPP_strxfrm_capture(char* __b, char const* __s, size_t __n)
{ return strxfrm(__b, __s, __n); }
inline void*
_CPP_memchr_capture(void const* __s1, int __c, size_t __n)
{ return memchr(__s1, __c, __n); }
inline char*
_CPP_strchr_capture(char const* __s1, int __c)
{ return strchr(__s1, __c); }
inline size_t
_CPP_strcspn_capture(char const* __s1, char const* __s2)
{ return strcspn(__s1, __s2); }
inline char*
_CPP_strpbrk_capture(char const* __s1, char const* __s2)
{ return strpbrk(__s1, __s2); }
inline char*
_CPP_strrchr_capture(char const* __s1, int __c)
{ return strrchr(__s1, __c); }
inline size_t
_CPP_strspn_capture(char const* __s1, char const* __s2)
{ return strspn(__s1, __s2); }
inline char*
_CPP_strstr_capture(char const* __s1, char const* __s2)
{ return strstr(__s1, __s2); }
inline char*
_CPP_strtok_capture(char* __s1, char const* __s2)
{ return strtok(__s1, __s2); }
inline void*
_CPP_memset_capture(void* __s, int __c, size_t __n)
{ return memset(__s, __c, __n); }
// inline char*
// _CPP_strerror_capture(int __num)
// { return strerror(__num); }
inline size_t
_CPP_strlen_capture(char const* __s)
{ return strlen(__s); }
} // namespace _C_legacy
# undef memcpy
# undef memmove
# undef strcpy
# undef strncpy
# undef strcat
# undef strncat
# undef memcmp
# undef strcmp
# undef strcoll
# undef strncmp
# undef strxfrm
# undef memchr
# undef strchr
# undef strcspn
# undef strpbrk
# undef strrchr
# undef strspn
# undef strstr
# undef strtok
# undef memset
# undef strerror
# undef strlen
namespace std {
// Redefine most of these inline. Note that the
// C++ definition differs from C in some cases.
inline void*
memcpy(void* __s1, void const* __s2, size_t __n)
{ return _C_legacy::_CPP_memcpy_capture(__s1, __s2, __n); }
inline void*
memmove(void* __s1, void const* __s2, size_t __n)
{ return _C_legacy::_CPP_memmove_capture(__s1, __s2, __n); }
inline void* #endif
strcpy(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcpy_capture(__s1, __s2); }
inline char*
strncpy(char* __s1, char const* __s2, size_t __n)
{ return _C_legacy::_CPP_strncpy_capture(__s1, __s2, __n); }
inline char*
strcat(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcat_capture(__s1, __s2); }
inline char*
strncat(char* __s1, char const* __s2, size_t __n)
{ return _C_legacy::_CPP_strncat_capture(__s1, __s2, __n); }
inline int
memcmp(void const* __s1, void const* __s2, size_t __n)
{ return _C_legacy::_CPP_memcmp_capture(__s1, __s2, __n); }
inline int
strcmp(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcmp_capture(__s1, __s2); }
inline int
strcoll(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcoll_capture(__s1, __s2); }
inline int
strncmp(char const* __s1, char const* __s2, size_t __n)
{ return _C_legacy::_CPP_strncmp_capture(__s1, __s2, __n); }
inline size_t
strxfrm(char* __b, char const* __s, size_t __n)
{ return _C_legacy::_CPP_strxfrm_capture(__b, __s, __n); }
inline void
const* memchr(void const* __s1, int __c, size_t __n)
{ return _C_legacy::_CPP_memchr_capture(__s1, __c, __n); }
inline void*
memchr(void* __s1, int __c, size_t __n)
{ return _C_legacy::_CPP_memchr_capture(__s1, __c, __n); }
inline char const*
strchr(char const* __s1, int __c)
{ return _C_legacy::_CPP_strchr_capture(__s1, __c); }
inline char*
strchr(char* __s1, int __c)
{ return _C_legacy::_CPP_strchr_capture(__s1, __c); }
inline size_t
strcspn(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strcspn_capture(__s1, __s2); }
inline char const*
strpbrk(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strpbrk_capture(__s1, __s2); }
inline char*
strpbrk(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strpbrk_capture(__s1, __s2); }
inline char const*
strrchr(char const* __s1, int __c)
{ return _C_legacy::_CPP_strrchr_capture(__s1, __c); }
inline char*
strrchr(char* __s1, int __c)
{ return _C_legacy::_CPP_strrchr_capture(__s1, __c); }
inline size_t
strspn(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strspn_capture(__s1, __s2); }
inline char const*
strstr(char const* __s1, char const* __s2)
{ return _C_legacy::_CPP_strstr_capture(__s1, __s2); }
inline char*
strstr(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strstr_capture(__s1, __s2); }
inline char*
strtok(char* __s1, char const* __s2)
{ return _C_legacy::_CPP_strtok_capture(__s1, __s2); }
inline void*
memset(void* __s, int __c, size_t __n)
{ return _C_legacy::_CPP_memset_capture(__s, __c, __n); }
using _C_legacy::strerror;
inline size_t
strlen(char const* __s)
{ return _C_legacy::_CPP_strlen_capture(__s); }
} // namespace std
# undef _IN_C_LEGACY_
#endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -31,77 +31,29 @@ ...@@ -31,77 +31,29 @@
// ISO C++ 14882: 20.5 Date and time // ISO C++ 14882: 20.5 Date and time
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CTIME #ifndef _CPP_CTIME
#define _CPP_CTIME 1 #define _CPP_CTIME 1
# include <bits/std_cstddef.h> #pragma GCC system_header
#include <time.h>
namespace _C_legacy {
extern "C" { namespace std
# define _IN_C_LEGACY_ {
# pragma GCC system_header using ::clock_t;
using ::time_t;
// XXX using ::tm;
// glibc 2.1.x time.h is on crack
# undef __need_time_t extern "C" clock_t clock(void);
# undef __need_clock_t extern "C" double difftime(time_t, time_t);
# undef __need_timespec extern "C" time_t mktime(struct tm*);
extern "C" time_t time(time_t*);
# include_next <time.h> extern "C" char* asctime(const struct tm*);
} extern "C" char* ctime(const time_t*);
extern "C" struct tm* gmtime(const time_t*);
typedef clock_t _CPP_clock_t_capture; extern "C" struct tm* localtime(const time_t*);
typedef time_t _CPP_time_t_capture; extern "C" size_t strftime(char*, size_t, const char*, const struct tm*);
typedef tm _CPP_tm_capture; }
} // namespace _C_legacy
# undef clock_t
# undef time_t
# undef tm
# undef clock
# undef difftime
# undef mktime
# undef time
# undef asctime
# undef ctime
# undef gmtime
# undef localtime
# undef strftime
namespace std {
// Adopt C names into std::
typedef _C_legacy::_CPP_clock_t_capture clock_t;
typedef _C_legacy::_CPP_time_t_capture time_t;
struct tm : _C_legacy::_CPP_tm_capture { };
using _C_legacy::clock;
using _C_legacy::difftime;
using _C_legacy::mktime;
using _C_legacy::time;
using _C_legacy::ctime;
inline char*
asctime(const tm* __t)
{ return _C_legacy::asctime(static_cast<_C_legacy::_CPP_tm_capture const*>(__t)); }
inline tm*
gmtime(time_t const* __tp)
{ return reinterpret_cast<tm*>(_C_legacy::gmtime(__tp)); }
inline tm*
localtime(const time_t* __tp)
{ return reinterpret_cast<tm*>(_C_legacy::localtime(__tp)); }
inline size_t
strftime(char* __buf, size_t __maxsz, char const* __fmt, tm const* __tp)
{ return _C_legacy::strftime(__buf, __maxsz, __fmt,
static_cast<_C_legacy::_CPP_tm_capture const*>(__tp)); }
} // namespace std
# undef _IN_C_LEGACY_
#endif #endif
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the // software; you can redistribute it and/or modify it under the
...@@ -28,246 +28,128 @@ ...@@ -28,246 +28,128 @@
// the GNU General Public License. // the GNU General Public License.
// //
// ISO C++ 14882: 21 // ISO C++ 14882: ???
//
#ifndef _CPP_CWCHAR // Note: This is not a conforming implementation.
# define _CPP_CWCHAR 1
# include <bits/std_cstdio.h>
namespace _C_legacy { #ifndef _CPP_CWCHAR
extern "C" { #define _CPP_CWCHAR 1
# define _IN_C_LEGACY_
# pragma GCC system_header #include <bits/c++config.h>
# include_next <wchar.h> #include <bits/std_cstdio.h>
} #include <bits/std_cstdarg.h>
#if _GLIBCPP_USE_WCHAR_T
#pragma GCC system_header
#include <wchar.h>
// Get rid of those macros defined in <wchar.h> in lieu of real functions.
#undef getwchar
namespace std
{
using ::wint_t;
using ::mbstate_t;
extern "C" wint_t btowc(int);
extern "C" int wctob(wint_t);
extern "C" wint_t fgetwc(FILE*);
extern "C" wchar_t* fgetws(wchar_t*, int, FILE*);
extern "C" wint_t fputwc(wchar_t, FILE*);
extern "C" int fputws(const wchar_t*, FILE*);
extern "C" int fwide(FILE*, int);
extern "C" int fwprintf(FILE*, const wchar_t*, ...);
extern "C" int fwscanf(FILE*, const wchar_t*, ...);
extern "C" int swprintf(wchar_t*, size_t, const wchar_t*, ...);
extern "C" int swscanf(const wchar_t*, const wchar_t*, ...);
extern "C" int vfwprintf(FILE*, const wchar_t*, va_list);
extern "C" int vfwscanf(FILE*, const wchar_t*, va_list);
extern "C" int vswprintf(wchar_t*, size_t, const wchar_t*, va_list);
extern "C" int vswscanf(const wchar_t*, const wchar_t*, va_list);
extern "C" int vwprintf(const wchar_t*, va_list);
extern "C" int vwscanf(const wchar_t*, va_list);
extern "C" int wprintf(const wchar_t*, ...);
extern "C" int wscanf(const wchar_t*, ...);
extern "C" wint_t getwc(FILE* stream);
extern "C" wint_t getwchar(void);
extern "C" int mbsinit(const mbstate_t*);
extern "C" size_t mbrlen(const char*, size_t, mbstate_t*);
extern "C" size_t mbrtowc(wchar_t*, const char*, size_t, mbstate_t*);
extern "C" size_t mbsrtowcs(wchar_t*, const char**, size_t, mbstate_t*);
extern "C" size_t wcsrtombs(char*, const wchar_t **, size_t, mbstate_t*);
extern "C" wint_t putwc(wchar_t, FILE*);
extern "C" wint_t putwchar(wchar_t);
extern "C" wint_t ungetwc(wint_t, FILE*);
extern "C" size_t wcrtomb(char*, wchar_t, mbstate_t*);
extern "C" double wcstod(const wchar_t*, wchar_t**);
extern "C" float wcstof(const wchar_t*, wchar_t**);
extern "C" long int wcstol(const wchar_t*, wchar_t**, int);
extern "C" unsigned long int wcstoul(const wchar_t*, wchar_t**, int);
extern "C" wchar_t* wcscpy(wchar_t* s1, const wchar_t*);
extern "C" wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
extern "C" wchar_t* wcscat(wchar_t*, const wchar_t*);
extern "C" wchar_t* wcsncat(wchar_t*, const wchar_t*, size_t);
extern "C" int wcscmp(const wchar_t*, const wchar_t*);
extern "C" int wcscoll(const wchar_t*, const wchar_t*);
extern "C" int wcsncmp(const wchar_t*, const wchar_t*, size_t);
extern "C" size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
extern "C" wchar_t* wcschr(const wchar_t*, wchar_t);
extern "C" size_t wcscspn(const wchar_t*, const wchar_t*);
extern "C" size_t wcslen(const wchar_t*);
extern "C" wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
extern "C" wchar_t* wcsrchr(const wchar_t*, wchar_t);
extern "C" size_t wcsspn(const wchar_t*, const wchar_t*);
extern "C" wchar_t* wcsstr(const wchar_t*, const wchar_t*);
extern "C" wchar_t* wcstok(wchar_t*, const wchar_t*, wchar_t**);
extern "C" wchar_t* wmemchr(const wchar_t*, wchar_t, size_t);
extern "C" int wmemcmp(const wchar_t*, const wchar_t*, size_t);
//extern "C" int wmemcmp(wchar_t*, const wchar_t*, size_t);
extern "C" wchar_t* wmemcpy(wchar_t*, const wchar_t*, size_t);
extern "C" wchar_t* wmemmove(wchar_t*, const wchar_t*, size_t);
extern "C" wchar_t* wmemset(wchar_t*, wchar_t, size_t);
extern "C" size_t wcsftime(wchar_t*, size_t, const wchar_t*, const struct tm*);
#if 0 #if 0
// XXX // Full C99 listing
inline int extern "C" long double wcstold(const wchar_t*, wchar_t**);
fwprintf(FILE* __stream, const wchar_t* __format, ...); extern "C" long long int wcstoll(const wchar_t*, wchar_t**, int);
extern "C" unsigned long long int wcstoull(const wchar_t*, wchar_t**, int);
inline int
fwscanf(FILE* __stream, const wchar_t* __format, ...);
inline int
vfwprintf(FILE* __stream, const wchar_t* __format, va_list __arg);
inline int
vfwscanf(FILE* __stream, const wchar_t* __format, va_list __arg);
inline wint_t
_CPP_fgetwc_capture(FILE* __stream)
{ return fgetwc(__stream); }
inline wchar_t*
_CPP_fgetws_capture(wchar_t* __s, int __n, FILE* __stream)
{ return fgetws(__s, __n, __stream); }
inline wint_t
_CPP_fputwc_capture(wchar_t __c, FILE* __stream)
{ return fputwc(__c, __stream); }
inline int
_CPP_fputws_capture(const wchar_t* __s, FILE* __stream)
{ return fputws(__s, __stream); }
inline int
_CPP_fwide_capture(FILE* __stream, int __mode)
{ return fwide(__stream, __mode); }
inline wint_t
_CPP_fgetwc_capture(FILE* __stream)
{ return fgetwc(__stream); }
inline wint_t
_CPP_putwc_capture(wchar_t __c, FILE* __stream)
{ return putwc(__c, __stream); }
inline wint_t
_CPP_ungetwc_capture(wint_t __c, FILE* __stream)
{ return ungetwc(__c, __stream); }
#endif #endif
} // namespace _C_legacy }
# undef wchar_t #else
# undef wint_t extern "C"
# undef mbstate_t {
typedef struct
# undef fwprintf {
# undef fwscanf int __fill[6];
# undef swprintf } mbstate_t;
# undef swscanf }
# undef vfwprintf
# undef vfwscanf namespace std
# undef vswprintf {
# undef vswscanf using ::mbstate_t;
# undef vwprintf }
# undef vwscanf #endif //_GLIBCPP_USE_WCHAR_T
# undef wprintf
# undef wscanf
# undef fgetwc #endif
# undef fgetws
# undef fputwc
# undef fputws
# undef fwide
# undef getwc
# undef getwchar
# undef putwc
# undef putwchar
# undef ungetwc
# undef wcstod
# undef wcstof
# undef wcstold
# undef wcstol
# undef wcstoll
# undef wcstoul
# undef wcstoull
# undef wcscpy
# undef wcsncpy
# undef wcscat
# undef wcsncat
# undef wcsmp
# undef wcscoll
# undef wcsncmp
# undef wcsxfrm
# undef wcschr
# undef wcscspn
# undef wcslen
# undef wcspbrk
# undef wcsrchr
# undef wcsspn
# undef wcsstr
# undef wcstok
# undef wmemchr
# undef wmemcmp
# undef wmemcpy
# undef wmemmove
# undef wmemset
# undef wcsftime
# undef btowc
# undef wctob
# undef mbsinit
# undef mbrlen
# undef mbrtowc
# undef wcrtomb
# undef mbsrtowcs
# undef wcsrtombs
namespace std {
using _C_legacy::wint_t;
using _C_legacy::mbstate_t;
#if 0
using _C_legacy::swprintf;
using _C_legacy::swscanf;
using _C_legacy::vswprintf;
using _C_legacy::vswscanf;
using _C_legacy::vwprintf;
using _C_legacy::vwscanf;
using _C_legacy::wprintf;
using _C_legacy::wscanf;
using _C_legacy::getwchar;
using _C_legacy::putwchar;
#endif
using _C_legacy::wcstod;
using _C_legacy::wcstof;
using _C_legacy::wcstold;
using _C_legacy::wcstol;
using _C_legacy::wcstoll;
using _C_legacy::wcstoul;
using _C_legacy::wcstoull;
using _C_legacy::wcscpy;
using _C_legacy::wcsncpy;
using _C_legacy::wcscat;
using _C_legacy::wcsncat;
#if 0
using _C_legacy::wcsmp;
#endif
using _C_legacy::wcscoll;
using _C_legacy::wcsncmp;
using _C_legacy::wcsxfrm;
using _C_legacy::wcschr;
using _C_legacy::wcscspn;
using _C_legacy::wcslen;
using _C_legacy::wcspbrk;
using _C_legacy::wcsrchr;
using _C_legacy::wcsspn;
using _C_legacy::wcsstr;
using _C_legacy::wcstok;
using _C_legacy::wmemchr;
using _C_legacy::wmemcmp;
using _C_legacy::wmemcpy;
using _C_legacy::wmemmove;
using _C_legacy::wmemset;
#if 0
using _C_legacy::wcsftime;
#endif
using _C_legacy::btowc;
using _C_legacy::wctob;
using _C_legacy::mbsinit;
using _C_legacy::mbrlen;
using _C_legacy::mbrtowc;
using _C_legacy::wcrtomb;
using _C_legacy::mbsrtowcs;
using _C_legacy::wcsrtombs;
#if 0
// XXX
inline int
fwprintf(FILE* __stream, const wchar_t* __format, ...);
inline int
fwscanf(FILE* __stream, const wchar_t* __format, ...);
inline int
vfwprintf(FILE* __stream, const wchar_t* __format, va_list __arg);
inline int
vfwscanf(FILE* __stream, const wchar_t* __format, va_list __arg);
inline wint_t
fgetwc(FILE* __stream)
{ return _C_legacy::_CPP_fgetwc_capture(__stream); }
inline wchar_t*
fgetws(wchar_t* __s, int __n, FILE* __stream)
{ return _C_legacy::_CPP_fgetws_capture(__s, __n, __stream); }
inline wint_t
fputwc(wchar_t __c, FILE* __stream)
{ return _C_legacy::_CPP_fputwc_capture(__c, __stream); }
inline int
fputws(const wchar_t* __s, FILE* __stream)
{ return _C_legacy::_CPP_fputws_capture(__s, __stream); }
inline int
fwide(FILE* __stream, int __mode)
{ return _C_legacy::_CPP_fwide_capture(__stream, __mode); }
inline wint_t
getwc(FILE* __stream)
{ return _C_legacy::_CPP_getwc_capture(__stream); }
inline wint_t
putwc(wchar_t __c, FILE* __stream)
{ return _C_legacy::_CPP_putwc_capture(__c, __stream); }
inline wint_t
ungetwc(wint_t __c, FILE* __stream)
{ return _C_legacy::_CPP_ungetwc_capture(__c, __stream); }
#endif
}
# undef _IN_C_LEGACY_
#endif
......
// -*- C++ -*- header wrapper. // -*- C++ -*- forwarding header.
// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
// //
...@@ -28,102 +28,67 @@ ...@@ -28,102 +28,67 @@
// the GNU General Public License. // the GNU General Public License.
// //
// ISO C++ 14882: // ISO C++ 14882: <cwctype>
// //
// Note: This is not a conforming implementation.
#ifndef _CPP_CWCTYPE #ifndef _CPP_CWCTYPE
#define _CPP_CWCTYPE 1 #define _CPP_CWCTYPE 1
# include <bits/std_cwchar.h> #pragma GCC system_header
#include <wctype.h>
namespace _C_legacy {
extern "C" { // Get rid of those macros defined in <wctype.h> in lieu of real functions.
# define _IN_C_LEGACY_ #undef iswalnum
# pragma GCC system_header #undef iswalpha
# include_next <wctype.h> #undef iswblank
} #undef iswcntrl
} // namespace _C_legacy #undef iswdigit
#undef iswgraph
#undef iswlower
# undef wctype_t #undef iswprint
# undef wctrans_t #undef iswprint
# undef iswalpha #undef iswpunct
# undef iswupper #undef iswspace
# undef iswlower #undef iswupper
# undef iswdigit #undef iswxdigit
# undef iswxdigit #undef iswctype
# undef iswalnum #undef towlower
# undef iswspace #undef towupper
# undef iswpunct #undef towctrans
# undef iswprint #undef wctrans
# undef iswgraph
# undef iswcntrl namespace std
# undef iswctype {
# undef towctrans using ::wctype_t;
# undef towlower using ::wctrans_t;
# undef towupper
# undef wctrans extern "C" int iswalnum(wint_t);
# undef wctype extern "C" int iswalpha(wint_t);
extern "C" int iswblank(wint_t);
namespace std { extern "C" int iswcntrl(wint_t);
using _C_legacy::wctype_t; extern "C" int iswdigit(wint_t);
using _C_legacy::wctrans_t; extern "C" int iswgraph(wint_t);
extern "C" int iswlower(wint_t);
inline int extern "C" int iswprint(wint_t);
iswalpha(wint_t __wc) { return _C_legacy::iswalpha(__wc); } extern "C" int iswpunct(wint_t);
extern "C" int iswspace(wint_t);
inline int extern "C" int iswupper(wint_t);
iswupper(wint_t __wc) { return _C_legacy::iswupper(__wc); } extern "C" int iswxdigit(wint_t);
extern "C" int iswctype(wint_t, wctype_t);
inline int extern "C" wctype_t wctype(const char *);
iswlower(wint_t __wc) { return _C_legacy::iswlower(__wc); } extern "C" wint_t towlower(wint_t);
extern "C" wint_t towupper(wint_t);
inline int extern "C" wint_t towctrans(wint_t, wctrans_t);
iswdigit(wint_t __wc) { return _C_legacy::iswdigit(__wc); } extern "C" wctrans_t wctrans(const char*);
}
inline int
iswxdigit(wint_t __wc) { return _C_legacy::iswxdigit(__wc); } #endif
inline int
iswalnum(wint_t __wc) { return _C_legacy::iswalnum(__wc); }
inline int
iswspace(wint_t __wc) { return _C_legacy::iswspace(__wc); }
inline int
iswpunct(wint_t __wc) { return _C_legacy::iswpunct(__wc); }
inline int
iswprint(wint_t __wc) { return _C_legacy::iswprint(__wc); }
inline int
iswgraph(wint_t __wc) { return _C_legacy::iswgraph(__wc); }
inline int
iswcntrl(wint_t __wc) { return _C_legacy::iswcntrl(__wc); }
inline int
towlower(wint_t __wc) { return _C_legacy::towlower(__wc); }
inline int
towupper(wint_t __wc) { return _C_legacy::towupper(__wc); }
inline int
iswctype(wint_t __wc, wctype_t __desc)
{ return _C_legacy::iswctype(__wc, __desc); }
inline wint_t
towctrans(wint_t __wc, wctrans_t __desc)
{ return _C_legacy::towctrans (__wc, __desc); }
inline wctrans_t
wctrans(const char *__property) { return _C_legacy::wctrans(__property); }
inline wctype_t
wctype(char const* __property) { return _C_legacy::wctype(__property); }
} // namespace std
# undef _IN_C_LEGACY_
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment