summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/c
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-31 01:26:06 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-31 01:26:06 +0000
commit36badd1d54a77e3f220ab5ceccf79731a16be405 (patch)
tree2e8590154664aecb09e8512679ca63219b2abdb8 /libstdc++-v3/include/c
parent396ffa866b4e8c2ac1d3b2ec6f1f687cfdd4568b (diff)
downloadppe42-gcc-36badd1d54a77e3f220ab5ceccf79731a16be405.tar.gz
ppe42-gcc-36badd1d54a77e3f220ab5ceccf79731a16be405.zip
2000-10-30 Benjamin Kosnik <bkoz@redhat.com>
* src/complex_io.cc : Remove ancient defines. * config/os/gnu-linux/bits/os_defines.h: Add defines. * libsupc++/tinfo2.cc: Change to cstddef. * include/bits/codecvt.h: Add include of c++config.h, so that __USE_GNU gets defined. (Important for alpha.) * include/c/bits/std_cwctype.h: Same. * include/c/bits/std_ctime.h: And here. * include/c/bits/std_cstdarg.h: Same. * include/c/bits/std_csignal.h: Same. * include/c/bits/std_csetjmp.h: Same. * include/c/bits/std_clocale.h: Same. * include/c/bits/std_climits.h: Touch. * include/c/bits/std_cfloat.h: Same. * include/c/bits/std_cerrno.h: Same. * include/c/bits/std_cwchar.h: Same. * include/c/bits/std_cassert.h: Same. * include/c/bits/std_cctype.h: Same. * include/c/bits/std_cstddef.h: And here. * include/c/bits/std_cstdlib.h: And here. * include/c/bits/std_cstdio.h: Same. * include/c/bits/std_cstring.h: Add names to namespace std::. * include/bits/c++config (_GNU_SOURCE): Move linux-specific macros from here... (_ISOC99_SOURCE): And this one.... * config/os/gnu-linux/bits/os_defines.h: ...to here. * include/bits/codecvt.h (codecvt<_InternT, _ExternT, __enc_traits>::do_in): Don't cast to const, this is a bug in glibc prior to 2.2. (codecvt<_InternT, _ExternT, __enc_traits>::do_out): Same. * include/c/bits/std_cwchar.h: Add using declarations for mbstate_t. 2000-10-30 Steven King <sxking@uswest.net> * include/bits/codecvt.h: Add cast. * include/c_std/stdio.h: Re-add printf using declaration. * include/c_std/bits/std_cstdio.h: Same * testsuite/22_locale/codecvt_wchar_t_char.cc: Fixup testsuite. * testsuite/22_locale/ctor_copy_dtor.cc: Same. * testsuite/22_locale/facet.cc: Same. * testsuite/22_locale/global_templates.cc: Same. * testsuite/22_locale/operators.cc: Same. * testsuite/22_locale/static_members.cc: Same. * testsuite/26_numerics/c_math.cc: Same. * testsuite/26_numerics/complex_inserters_extractors.cc: Same. * testsuite/27_io/fpos.cc: Same. * testsuite/27_io/istream_extractor_arith.cc: Same. * testsuite/27_io/istream_unformatted.cc: Same. * testsuite/27_io/ostream_inserter_arith.cc: Same. * testsuite/27_io/streambuf.cc: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37149 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/c')
-rw-r--r--libstdc++-v3/include/c/bits/std_cassert.h16
-rw-r--r--libstdc++-v3/include/c/bits/std_cctype.h183
-rw-r--r--libstdc++-v3/include/c/bits/std_cerrno.h17
-rw-r--r--libstdc++-v3/include/c/bits/std_cfloat.h18
-rw-r--r--libstdc++-v3/include/c/bits/std_climits.h9
-rw-r--r--libstdc++-v3/include/c/bits/std_clocale.h21
-rw-r--r--libstdc++-v3/include/c/bits/std_cmath.h37
-rw-r--r--libstdc++-v3/include/c/bits/std_csetjmp.h16
-rw-r--r--libstdc++-v3/include/c/bits/std_csignal.h17
-rw-r--r--libstdc++-v3/include/c/bits/std_cstdarg.h15
-rw-r--r--libstdc++-v3/include/c/bits/std_cstddef.h19
-rw-r--r--libstdc++-v3/include/c/bits/std_cstdio.h74
-rw-r--r--libstdc++-v3/include/c/bits/std_cstdlib.h88
-rw-r--r--libstdc++-v3/include/c/bits/std_cstring.h45
-rw-r--r--libstdc++-v3/include/c/bits/std_ctime.h27
-rw-r--r--libstdc++-v3/include/c/bits/std_cwchar.h92
-rw-r--r--libstdc++-v3/include/c/bits/std_cwctype.h144
17 files changed, 458 insertions, 380 deletions
diff --git a/libstdc++-v3/include/c/bits/std_cassert.h b/libstdc++-v3/include/c/bits/std_cassert.h
index 5d9d18445f9..0cd937e4039 100644
--- a/libstdc++-v3/include/c/bits/std_cassert.h
+++ b/libstdc++-v3/include/c/bits/std_cassert.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -35,5 +35,15 @@
// No include guards on this header...
-# pragma GCC system_header
-# include_next <assert.h>
+#pragma GCC system_header
+#include_next <assert.h>
+
+
+
+
+
+
+
+
+
+
diff --git a/libstdc++-v3/include/c/bits/std_cctype.h b/libstdc++-v3/include/c/bits/std_cctype.h
index 1c1e69c6c5d..bb50610b815 100644
--- a/libstdc++-v3/include/c/bits/std_cctype.h
+++ b/libstdc++-v3/include/c/bits/std_cctype.h
@@ -31,172 +31,35 @@
// ISO C++ 14882: <ccytpe>
//
+// Note: This is not a conforming implementation.
+
#ifndef _CPP_CCTYPE
#define _CPP_CCTYPE 1
-// This keeps isanum, et al from being propagated as macros.
-#if __linux__
-#define __NO_CTYPE 1
-#endif
-
-# pragma GCC system_header
-# include_next <ctype.h>
+#include <bits/c++config.h>
-// Sequester the C non-inline implementations in the _C_Swamp::
-// namespace, and provide C++ inlines for them in the std:: namespace
-// where they belong.
+#pragma GCC system_header
+#include_next <ctype.h>
-namespace std
+namespace std
{
- // NB: If not using namespaces, can't have any of these definitions,
- // as they will duplicate what's in the global namespace.
-
-#ifdef toupper
- inline int
- _S_toupper_helper(int __c) { return toupper(__c); }
-# undef toupper
- inline int
- toupper(int __c) { return _S_toupper_helper(__c); }
-#else
- inline int
- toupper(int __c) { return ::toupper(__c); }
-#endif
-
-#ifdef tolower
- inline int
- _S_tolower_helper(int __c) { return tolower(__c); }
-# undef tolower
- inline int
- tolower(int __c) { return _S_tolower_helper(__c); }
-#else
- inline int
- tolower(int __c) { return ::tolower(__c); }
-#endif
-
-#ifdef isspace
- inline int
- _S_isspace_helper(int __c) { return isspace(__c); }
-# undef isspace
- inline int
- isspace(int __c) { return _S_isspace_helper(__c); }
-#else
- inline int
- isspace(int __c) { return ::isspace(__c); }
-#endif
-
-#ifdef isprint
- inline int
- _S_isprint_helper(int __c) { return isprint(__c); }
-# undef isprint
- inline int
- isprint(int __c) { return _S_isprint_helper(__c); }
-#else
- inline int
- isprint(int __c) { return ::isprint(__c); }
-#endif
-
-#ifdef iscntrl
- inline int
- _S_iscntrl_helper(int __c) { return iscntrl(__c); }
-# undef iscntrl
- inline int
- iscntrl(int __c) { return _S_iscntrl_helper(__c); }
-#else
- inline int
- iscntrl(int __c) { return ::iscntrl(__c); }
-#endif
-
-#ifdef isupper
- inline int
- _S_isupper_helper(int __c) { return isupper(__c); }
-# undef isupper
- inline int
- isupper(int __c) { return _S_isupper_helper(__c); }
-#else
- inline int
- isupper(int __c) { return ::isupper(__c); }
-#endif
-
-#ifdef islower
- inline int
- _S_islower_helper(int __c) { return islower(__c); }
-# undef islower
- inline int
- islower(int __c) { return _S_islower_helper(__c); }
-#else
- inline int
- islower(int __c) { return ::islower(__c); }
-#endif
-
-#ifdef isalpha
- inline int
- _S_isalpha_helper(int __c) { return isalpha(__c); }
-# undef isalpha
- inline int
- isalpha(int __c) { return _S_isalpha_helper(__c); }
-#else
- inline int
- isalpha(int __c) { return ::isalpha(__c); }
-#endif
-
-#ifdef isdigit
- inline int
- _S_isdigit_helper(int __c) { return isdigit(__c); }
-# undef isdigit
- inline int
- isdigit(int __c) { return _S_isdigit_helper(__c); }
-#else
- inline int
- isdigit(int __c) { return ::isdigit(__c); }
-#endif
-
-#ifdef ispunct
- inline int
- _S_ispunct_helper(int __c) { return ispunct(__c); }
-# undef ispunct
- inline int
- ispunct(int __c) { return _S_ispunct_helper(__c); }
-#else
- inline int
- ispunct(int __c) { return ::ispunct(__c); }
-#endif
-
-#ifdef isxdigit
- inline int
- _S_isxdigit_helper(int __c) { return isxdigit(__c); }
-# undef isxdigit
- inline int
- isxdigit(int __c) { return _S_isxdigit_helper(__c); }
-#else
- inline int
- isxdigit(int __c) { return ::isxdigit(__c); }
-#endif
-
-#ifdef isalnum
- inline int
- _S_isalnum_helper(int __c) { return isalnum(__c); }
-# undef isalnum
- inline int
- isalnum(int __c) { return _S_isalnum_helper(__c); }
-#else
- inline int
- isalnum(int __c) { return ::isalnum(__c); }
-#endif
-
-#ifdef isgraph
- inline int
- _S_isgraph_helper(int __c) { return isgraph(__c); }
-# undef isgraph
- inline int
- isgraph(int __c) { return _S_isgraph_helper(__c); }
-#else
- inline int
- isgraph(int __c) { return ::isgraph(__c); }
-#endif
-
-} // namespace std
-
-#endif // _CPP_CCTYPE
+ 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);
+}
+
+#endif
diff --git a/libstdc++-v3/include/c/bits/std_cerrno.h b/libstdc++-v3/include/c/bits/std_cerrno.h
index abd28d560d8..518651008ba 100644
--- a/libstdc++-v3/include/c/bits/std_cerrno.h
+++ b/libstdc++-v3/include/c/bits/std_cerrno.h
@@ -31,10 +31,21 @@
// ISO C++ 14882: 19.3 Error numbers
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CERRNO
#define _CPP_CERRNO 1
-# pragma GCC system_header
-# include_next <errno.h>
+
+#pragma GCC system_header
+#include_next <errno.h>
+
+namespace std
+{
+ extern "C" int errno;
+}
+
#endif
+
+
+
+
diff --git a/libstdc++-v3/include/c/bits/std_cfloat.h b/libstdc++-v3/include/c/bits/std_cfloat.h
index 8a317fcb490..4ff42b0865c 100644
--- a/libstdc++-v3/include/c/bits/std_cfloat.h
+++ b/libstdc++-v3/include/c/bits/std_cfloat.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,17 +31,13 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CFLOAT
#define _CPP_CFLOAT 1
-# pragma GCC system_header
-# include_next <float.h>
-
-#if 0
-# ifdef __GLIBC__
-// For GNU libc we must also include this one:
-# include <fenv.h>
-# endif
-#endif
+
+#pragma GCC system_header
+#include_next <float.h>
+
#endif
+
diff --git a/libstdc++-v3/include/c/bits/std_climits.h b/libstdc++-v3/include/c/bits/std_climits.h
index ddd6bd8b40f..d7b171df041 100644
--- a/libstdc++-v3/include/c/bits/std_climits.h
+++ b/libstdc++-v3/include/c/bits/std_climits.h
@@ -35,8 +35,13 @@
#ifndef _CPP_CLIMITS
#define _CPP_CLIMITS 1
-# pragma GCC system_header
-# include_next <limits.h>
+
+#pragma GCC system_header
+#include_next <limits.h>
+
#endif
+
+
+
diff --git a/libstdc++-v3/include/c/bits/std_clocale.h b/libstdc++-v3/include/c/bits/std_clocale.h
index a8a44b8571a..0ce02976fe4 100644
--- a/libstdc++-v3/include/c/bits/std_clocale.h
+++ b/libstdc++-v3/include/c/bits/std_clocale.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,11 +31,22 @@
// ISO C++ 14882: 18.2.2 Implementation properties: C library
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CLOCALE
-#define _CPP_CLOCALE 1
-# pragma GCC system_header
-# include_next <locale.h>
+#define _CPP_CLOCALE 1
+
+#pragma GCC system_header
+#include_next <locale.h>
+
+namespace std
+{
+ using ::lconv;
+ extern "C" char* setlocale(int, const char*);
+ extern "C" struct lconv* localeconv(void);
+}
+
#endif
+
+
diff --git a/libstdc++-v3/include/c/bits/std_cmath.h b/libstdc++-v3/include/c/bits/std_cmath.h
index fe09b224b94..5a2c5056737 100644
--- a/libstdc++-v3/include/c/bits/std_cmath.h
+++ b/libstdc++-v3/include/c/bits/std_cmath.h
@@ -31,23 +31,24 @@
// ISO C++ 14882: 26.5 C library
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CMATH
#define _CPP_CMATH 1
-# pragma GCC system_header
-# include_next <math.h>
-# include_next <stdlib.h>
-# include <bits/c++config.h>
-
-namespace std {
-
- inline int
- abs(int i) { return i > 0 ? i : -i; }
+#include <bits/c++config.h>
+#include <bits/std_cstdlib.h>
+
+#pragma GCC system_header
+#include_next <math.h>
+namespace std
+{
inline long
- abs(long i) { return i > 0 ? i : -i; }
+ abs(long __i) { return ::labs(__i); }
+
+ inline ldiv_t
+ div(long __i, long __j) { return ::ldiv(__i, __j); }
#if _GLIBCPP_HAVE___BUILTIN_FABSF
inline float
@@ -212,7 +213,8 @@ namespace std {
{ return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
#endif
- float pow(float, int);
+ float
+ pow(float, int);
#if _GLIBCPP_HAVE___BUILTIN_SINF
inline float
@@ -310,12 +312,10 @@ namespace std {
extern "C" double modf(double __x, double* __iptr);
-#if 0
extern "C" double pow(double __x, double __y);
- extern "C" double pow(double, int);
-#endif
- using ::pow;
+ double
+ pow(double __x, int __i);
#if _GLIBCPP_HAVE___BUILTIN_SIN
inline double
@@ -552,7 +552,10 @@ namespace std {
#endif
} // std
-#endif // _CPP_CMATH
+#endif
+
+
+
diff --git a/libstdc++-v3/include/c/bits/std_csetjmp.h b/libstdc++-v3/include/c/bits/std_csetjmp.h
index fc5b339036a..a7864b0fc1f 100644
--- a/libstdc++-v3/include/c/bits/std_csetjmp.h
+++ b/libstdc++-v3/include/c/bits/std_csetjmp.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,10 +31,18 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CSETJMP
#define _CPP_CSETJMP 1
-# pragma GCC system_header
-# include_next <setjmp.h>
+
+#pragma GCC system_header
+#include_next <setjmp.h>
+
+namespace std
+{
+ using ::jmp_buf;
+ extern "C" void longjmp(jmp_buf, int);
+}
+
#endif
diff --git a/libstdc++-v3/include/c/bits/std_csignal.h b/libstdc++-v3/include/c/bits/std_csignal.h
index 34c03eb3df1..48f6584b25d 100644
--- a/libstdc++-v3/include/c/bits/std_csignal.h
+++ b/libstdc++-v3/include/c/bits/std_csignal.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,10 +31,19 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CSIGNAL
#define _CPP_CSIGNAL 1
-# pragma GCC system_header
-# include_next <signal.h>
+
+#pragma GCC system_header
+#include_next <signal.h>
+
+namespace std
+{
+ using ::sig_atomic_t;
+ extern "C" void (*signal(int, void (*__func)(int)))(int);
+ extern "C" int raise(int);
+}
+
#endif
diff --git a/libstdc++-v3/include/c/bits/std_cstdarg.h b/libstdc++-v3/include/c/bits/std_cstdarg.h
index f7f4235a290..87a8a0f54b7 100644
--- a/libstdc++-v3/include/c/bits/std_cstdarg.h
+++ b/libstdc++-v3/include/c/bits/std_cstdarg.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,10 +31,17 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CSTDARG
#define _CPP_CSTDARG 1
-# pragma GCC system_header
-# include_next <stdarg.h>
+
+#pragma GCC system_header
+#include_next <stdarg.h>
+
+namespace std
+{
+ using ::va_list;
+}
+
#endif
diff --git a/libstdc++-v3/include/c/bits/std_cstddef.h b/libstdc++-v3/include/c/bits/std_cstddef.h
index ea517e41a4d..a256e854833 100644
--- a/libstdc++-v3/include/c/bits/std_cstddef.h
+++ b/libstdc++-v3/include/c/bits/std_cstddef.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,17 +31,18 @@
// ISO C++ 14882: 18.1 Types
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CSTDDEF
#define _CPP_CSTDDEF 1
-# pragma GCC system_header
-# include_next <stddef.h>
-#endif
-namespace std {
- using ::size_t;
- using ::ptrdiff_t;
-} // namespace std
+#pragma GCC system_header
+#include_next <stddef.h>
+namespace std
+{
+ using ::ptrdiff_t;
+ using ::size_t;
+}
+#endif
diff --git a/libstdc++-v3/include/c/bits/std_cstdio.h b/libstdc++-v3/include/c/bits/std_cstdio.h
index 919a03ca4c7..b5836244f2a 100644
--- a/libstdc++-v3/include/c/bits/std_cstdio.h
+++ b/libstdc++-v3/include/c/bits/std_cstdio.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,24 +31,68 @@
// ISO C++ 14882: 27.8.2 C Library files
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CSTDIO
#define _CPP_CSTDIO 1
-# pragma GCC system_header
-# include_next <stdio.h>
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END 2
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET 4
-#endif
+#include <bits/std_cstdarg.h>
+
+#pragma GCC system_header
+#include_next <stdio.h>
+
+namespace std
+{
+ using ::FILE;
+ using ::fpos_t;
+
+ extern "C" int remove(const char*);
+ extern "C" int rename(const char*, const char*);
+ extern "C" FILE* tmpfile(void);
+ extern "C" char* tmpnam(char*);
+ extern "C" int fclose(FILE*);
+ extern "C" int fflush(FILE*);
+ extern "C" FILE* fopen(const char*, const char*);
+ extern "C" FILE* freopen(const char*, const char*, FILE*);
+ extern "C" void setbuf(FILE*, char*);
+ extern "C" int setvbuf(FILE*, char*, int, size_t);
+ extern "C" int fprintf(FILE*, const char*, ...);
+ extern "C" int fscanf(FILE*, const char*, ...);
+ extern "C" int printf(const char*, ...);
+ extern "C" int scanf(const char*, ...);
+ extern "C" int snprintf(char *, size_t, const char*, ...);
+ extern "C" int sprintf(char *, const char*, ...);
+ extern "C" int sscanf(const char*, const char*, ...);
+ extern "C" int vfprintf(FILE*, const char*, va_list);
+ extern "C" int vfscanf(FILE*, const char*, va_list);
+ extern "C" int vprintf(const char*, va_list);
+ extern "C" int vscanf(const char*, va_list);
+ extern "C" int vsnprintf(char*, size_t, const char*, va_list);
+ extern "C" int vsprintf(char*, const char*, va_list);
+ extern "C" int vsscanf(const char*, const char*, va_list);
+ extern "C" int fgetc(FILE *);
+ extern "C" char *fgets(char*, int, FILE*);
+ extern "C" int fputc(int, FILE*);
+ extern "C" int fputs(const char*, FILE*);
+ extern "C" int getc(FILE*);
+ extern "C" int getchar(void);
+ extern "C" char *gets(char*);
+ extern "C" int putc(int, FILE*);
+ extern "C" int putchar(int);
+ extern "C" int puts(const char*);
+ extern "C" int ungetc(int, FILE*);
+ extern "C" size_t fread(void*, size_t, size_t, FILE*);
+ extern "C" size_t fwrite(const void*, size_t, size_t, FILE*);
+ extern "C" int fgetpos(FILE*, fpos_t*);
+ extern "C" int fseek(FILE*, long int, int);
+ extern "C" int fsetpos(FILE*, const fpos_t*);
+ extern "C" long int ftell(FILE*);
+ extern "C" void rewind(FILE*);
+ extern "C" void clearerr(FILE*);
+ extern "C" int feof(FILE*);
+ extern "C" int ferror(FILE*);
+ extern "C" void perror(const char*);
+}
#endif
diff --git a/libstdc++-v3/include/c/bits/std_cstdlib.h b/libstdc++-v3/include/c/bits/std_cstdlib.h
index ee5435739ad..10600e60f30 100644
--- a/libstdc++-v3/include/c/bits/std_cstdlib.h
+++ b/libstdc++-v3/include/c/bits/std_cstdlib.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,20 +31,92 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CSTDLIB
#define _CPP_CSTDLIB 1
-// This keeps isanum, et al from being propagated as macros.
-#if __linux__
-#define __USE_ISOC9X 1
+#include <bits/c++config.h>
+
+#pragma GCC system_header
+#include_next <stdlib.h>
+
+namespace std
+{
+ using ::div_t;
+ using ::ldiv_t;
+
+#ifdef _GLIBCPP_USE_LONG_LONG
+# ifdef _GLIBCPP_HAVE_LLDIV_T
+ using ::lldiv_t;
+# else
+ struct lldiv_t
+ {
+ long long quot;
+ long long rem;
+ };
+# endif
+#endif
+
+ extern "C" double atof(const char*);
+ extern "C" int atoi(const char*);
+ extern "C" long int atol(const char*);
+ extern "C" double strtod(const char*, char**);
+ extern "C" float strtof(const char*, char**);
+ extern "C" long int strtol(const char*, char**, int);
+ extern "C" unsigned long int strtoul(const char*, char**, int);
+ extern "C" int rand(void);
+ extern "C" void srand(unsigned int);
+ extern "C" void* calloc(size_t, size_t);
+ extern "C" void free(void*);
+ extern "C" void* malloc(size_t);
+ extern "C" void* realloc(void*, size_t);
+ extern "C" void abort(void);
+ extern "C" int atexit(void (*func)(void));
+ extern "C" void exit(int);
+ extern "C" void _Exit(int);
+ extern "C" char*getenv(const char*);
+ extern "C" int system(const char*);
+ extern "C" void* bsearch(const void*, const void*, size_t, size_t,
+ int (*comp)(const void *, const void *));
+ extern "C" void qsort(void*, size_t, size_t,
+ int (*comp)(const void *, const void *));
+ extern "C" int abs(int);
+ extern "C" long int labs(long int);
+ extern "C" div_t div(int, int);
+ extern "C" ldiv_t ldiv(long int, long int);
+ extern "C" int mblen(const char*, size_t);
+ extern "C" int mbtowc(wchar_t*, const char*, size_t);
+ extern "C" int wctomb(char*, wchar_t);
+ extern "C" size_t mbstowcs(wchar_t*, const char*, size_t);
+ extern "C" size_t wcstombs(char*, const wchar_t*, size_t);
+
+#ifdef _GLIBCPP_USE_LONG_LONG
+ inline long long
+ abs(long long __x) { return __x >= 0 ? __x : -__x; }
+
+ inline long long
+ llabs(long long __x) { return __x >= 0 ? __x : -__x; }
+
+ inline lldiv_t
+ div(long long __n, long long __d)
+ { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
+
+ inline lldiv_t
+ lldiv(long long __n, long long __d)
+ { 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
-# pragma GCC system_header
-# include_next <stdlib.h>
+#ifdef _GLIBCPP_HAVE_STRTOLD
+ extern "C" long double strtold(const char*, char**);
+#endif
+}
-#endif // _CPP_CSTDLIB
+#endif
diff --git a/libstdc++-v3/include/c/bits/std_cstring.h b/libstdc++-v3/include/c/bits/std_cstring.h
index 06bcdda6535..252693b40d4 100644
--- a/libstdc++-v3/include/c/bits/std_cstring.h
+++ b/libstdc++-v3/include/c/bits/std_cstring.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,14 +31,43 @@
// ISO C++ 14882: 20.4.6 C library
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CSTRING
#define _CPP_CSTRING 1
-# if defined __GLIBC__ && __GLIBC__ >= 2
-// We must not see the optimized string functions GNU libc defines.
-# define __NO_STRING_INLINES
-# endif
-# pragma GCC system_header
-# include_next <string.h>
+
+#include <bits/c++config.h>
+
+#pragma GCC system_header
+#include_next <string.h>
+
+namespace std
+{
+ extern "C" void* memcpy(void*, const void*, size_t);
+ extern "C" void* memmove(void*, const void*, size_t);
+ extern "C" char* strcpy(char*, const char*);
+ extern "C" char* strncpy(char*, const char*, size_t);
+ 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);
+ extern "C" int strcmp(const char*, const char*);
+ extern "C" int strcoll(const char*, const char*);
+ extern "C" int strncmp(const char*, const char*, size_t);
+ extern "C" size_t strxfrm(char*, const char*, size_t);
+ extern "C" void* memchr(const void*, int, size_t);
+ extern "C" char* strchr(const char*, int);
+ extern "C" size_t strcspn(const char*, const char*);
+ extern "C" char* strpbrk(const char*, const char*);
+ extern "C" char* strrchr(const char*, int);
+ extern "C" size_t strspn(const char*, const char*);
+ extern "C" char* strstr(const char*, const char*);
+ extern "C" char* strtok(char*, const char*);
+ extern "C" void* memset(void*, int, size_t);
+ extern "C" char* strerror(int);
+ extern "C" size_t strlen(const char*);
+}
+
#endif
+
+
+
diff --git a/libstdc++-v3/include/c/bits/std_ctime.h b/libstdc++-v3/include/c/bits/std_ctime.h
index b30b318f595..8c700e699f2 100644
--- a/libstdc++-v3/include/c/bits/std_ctime.h
+++ b/libstdc++-v3/include/c/bits/std_ctime.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997-1999 Free Software Foundation, Inc.
+// Copyright (C) 1997-1999, 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
@@ -31,10 +31,29 @@
// ISO C++ 14882: 20.5 Date and time
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CTIME
#define _CPP_CTIME 1
-# pragma GCC system_header
-# include_next <time.h>
+
+#pragma GCC system_header
+#include_next <time.h>
+
+namespace std
+{
+ using ::clock_t;
+ using ::time_t;
+ using ::tm;
+
+ extern "C" clock_t clock(void);
+ extern "C" double difftime(time_t, time_t);
+ extern "C" time_t mktime(struct tm*);
+ extern "C" time_t time(time_t*);
+ extern "C" char* asctime(const struct tm*);
+ extern "C" char* ctime(const time_t*);
+ extern "C" struct tm* gmtime(const time_t*);
+ extern "C" struct tm* localtime(const time_t*);
+ extern "C" size_t strftime(char*, size_t, const char*, const struct tm*);
+}
+
#endif
diff --git a/libstdc++-v3/include/c/bits/std_cwchar.h b/libstdc++-v3/include/c/bits/std_cwchar.h
index 77349f9d318..cc769402c53 100644
--- a/libstdc++-v3/include/c/bits/std_cwchar.h
+++ b/libstdc++-v3/include/c/bits/std_cwchar.h
@@ -31,31 +31,107 @@
// ISO C++ 14882: ???
//
-// Note: this is not a conforming implementation.
+// Note: This is not a conforming implementation.
#ifndef _CPP_CWCHAR
#define _CPP_CWCHAR 1
#include <bits/c++config.h>
+#include <bits/std_cstdio.h>
+#include <bits/std_cstdarg.h>
#if _GLIBCPP_USE_WCHAR_T
- # pragma GCC system_header
- # include_next <wchar.h>
+#pragma GCC system_header
+#include_next <wchar.h>
+
+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
+ // Full C9X listing
+ extern "C" long double wcstold(const wchar_t*, wchar_t**);
+ 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);
+#endif
+}
+
#else
-# ifdef __cplusplus
extern "C"
{
-#endif
typedef struct
{
int __fill[6];
} mbstate_t;
-# ifdef __cplusplus
}
-# endif
+
+namespace std
+{
+ using ::mbstate_t;
+}
#endif //_GLIBCPP_USE_WCHAR_T
-#endif // _CPP_CWCHAR
+
+#endif
diff --git a/libstdc++-v3/include/c/bits/std_cwctype.h b/libstdc++-v3/include/c/bits/std_cwctype.h
index c67f2ba9720..5757c14b16b 100644
--- a/libstdc++-v3/include/c/bits/std_cwctype.h
+++ b/libstdc++-v3/include/c/bits/std_cwctype.h
@@ -31,126 +31,40 @@
// ISO C++ 14882: <cwctype>
//
+// Note: This is not a conforming implementation.
+
#ifndef _CPP_CWCTYPE
#define _CPP_CWCTYPE 1
-# pragma GCC system_header
-# include_next <wctype.h>
-
-// Sequester the C non-inline implementations in the _C_Swamp::
-// namespace, and provide C++ inlines for them in the std:: namespace
-// where they belong.
+#pragma GCC system_header
+#include_next <wctype.h>
-namespace std
+namespace std
{
-
-#ifdef towupper
- inline wint_t
- _S_towupper_helper(wint_t __wc) { return towupper(__wc); }
-# undef towupper
- inline wint_t
- towupper(wint_t __wc) { return _S_towupper_helper(__wc); }
-#endif
-
-#ifdef towlower
- inline wint_t
- _S_towlower_helper(wint_t __wc) { return towlower(__wc); }
-# undef towlower
- inline wint_t
- towlower(wint_t __wc) { return _S_towlower_helper(__wc); }
-#endif
-
-#ifdef iswspace
- inline int
- _S_iswspace_helper(wint_t __wc) { return iswspace(__wc); }
-# undef iswspace
- inline int
- iswspace(wint_t __wc) { return _S_iswspace_helper(__wc); }
-#endif
-
-#ifdef iswprint
- inline int
- _S_iswprint_helper(wint_t __wc) { return iswprint(__wc); }
-# undef iswprint
- inline int
- iswprint(wint_t __wc) { return _S_iswprint_helper(__wc); }
-#endif
-
-#ifdef iswcntrl
- inline int
- _S_iswcntrl_helper(wint_t __wc) { return iswcntrl(__wc); }
-# undef iswcntrl
- inline int
- iswcntrl(wint_t __wc) { return _S_iswcntrl_helper(__wc); }
-#endif
-
-#ifdef iswupper
- inline int
- _S_iswupper_helper(wint_t __wc) { return iswupper(__wc); }
-# undef iswupper
- inline int
- iswupper(wint_t __wc) { return _S_iswupper_helper(__wc); }
-#endif
-
-#ifdef iswlower
- inline int
- _S_iswlower_helper(wint_t __wc) { return iswlower(__wc); }
-# undef iswlower
- inline int
- iswlower(wint_t __wc) { return _S_iswlower_helper(__wc); }
-#endif
-
-#ifdef iswalpha
- inline int
- _S_iswalpha_helper(wint_t __wc) { return iswalpha(__wc); }
-# undef iswalpha
- inline int
- iswalpha(wint_t __wc) { return _S_iswalpha_helper(__wc); }
-#endif
-
-#ifdef iswdigit
- inline int
- _S_iswdigit_helper(wint_t __wc) { return iswdigit(__wc); }
-# undef iswdigit
- inline int
- iswdigit(wint_t __wc) { return _S_iswdigit_helper(__wc); }
-#endif
-
-#ifdef iswpunct
- inline int
- _S_iswpunct_helper(wint_t __wc) { return iswpunct(__wc); }
-# undef iswpunct
- inline int
- iswpunct(wint_t __wc) { return _S_iswpunct_helper(__wc); }
-#endif
-
-#ifdef iswxdigit
- inline int
- _S_iswxdigit_helper (wint_t __wc) { return iswxdigit(__wc); }
-# undef iswxdigit
- inline int
- iswxdigit(wint_t __wc) { return _S_iswxdigit_helper(__wc); }
-#endif
-
-#ifdef iswalnum
- inline int
- _S_iswalnum_helper(wint_t __wc) { return iswalnum(__wc); }
-# undef iswalnum
- inline int
- iswalnum(wint_t __wc) { return _S_iswalnum_helper(__wc); }
-#endif
-
-#ifdef iswgraph
- inline int
- _S_iswgraph_helper(wint_t __wc) { return iswgraph(__wc); }
-# undef iswgraph
- inline int
- iswgraph(wint_t __wc) { return _S_iswgraph_helper(__wc); }
-#endif
-
-} // namespace std
-
-#endif // _CPP_CWCTYPE
+ using ::wctype_t;
+ using ::wctrans_t;
+
+ extern "C" int iswalnum(wint_t);
+ extern "C" int iswalpha(wint_t);
+ extern "C" int iswblank(wint_t);
+ extern "C" int iswcntrl(wint_t);
+ extern "C" int iswdigit(wint_t);
+ extern "C" int iswgraph(wint_t);
+ extern "C" int iswlower(wint_t);
+ extern "C" int iswprint(wint_t);
+ extern "C" int iswpunct(wint_t);
+ extern "C" int iswspace(wint_t);
+ extern "C" int iswupper(wint_t);
+ extern "C" int iswxdigit(wint_t);
+ extern "C" int iswctype(wint_t, wctype_t);
+ extern "C" wctype_t wctype(const char *);
+ extern "C" wint_t towlower(wint_t);
+ extern "C" wint_t towupper(wint_t);
+ extern "C" wint_t towctrans(wint_t, wctrans_t);
+ extern "C" wctrans_t wctrans(const char*);
+}
+
+#endif
OpenPOWER on IntegriCloud