OSDN Git Service

2003-07-04 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / c_std / std_cstdlib.h
index 70fc8d3..5cac120 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*- forwarding header.
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -41,8 +41,8 @@
  *  contained in the namespace @c std.
  */
 
-#ifndef _CPP_CSTDLIB
-#define _CPP_CSTDLIB 1
+#ifndef _CSTDLIB
+#define _CSTDLIB 1
 
 #pragma GCC system_header
 
@@ -122,7 +122,7 @@ namespace std
   div(long __i, long __j) { return ldiv(__i, __j); }
 } 
 
-#if _GLIBCPP_USE_C99
+#if _GLIBCXX_USE_C99
 
 #undef _Exit
 #undef llabs
@@ -135,8 +135,15 @@ namespace std
 
 namespace __gnu_cxx
 {
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
   using ::lldiv_t;
+#endif
+#if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
+  extern "C" void (_Exit)(int);
+#endif
+#if !_GLIBCXX_USE_C99_DYNAMIC
   using ::_Exit;
+#endif
 
   inline long long 
   abs(long long __x) { return __x >= 0 ? __x : -__x; }
@@ -144,6 +151,7 @@ namespace __gnu_cxx
   inline long long 
   llabs(long long __x) { return __x >= 0 ? __x : -__x; }
 
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
   inline lldiv_t 
   div(long long __n, long long __d)
   { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
@@ -151,22 +159,36 @@ namespace __gnu_cxx
   inline lldiv_t 
   lldiv(long long __n, long long __d)
   { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
+#endif
 
+#if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+  extern "C" long long int (atoll)(const char *);
+  extern "C" long long int
+    (strtoll)(const char * restrict, char ** restrict, int);
+  extern "C" unsigned long long int
+    (strtoull)(const char * restrict, char ** restrict, int);
+#endif
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
   using ::atoll;
-  using ::strtof;
   using ::strtoll;
   using ::strtoull;
+#endif
+  using ::strtof;
   using ::strtold; 
 } 
 
 namespace std
 {
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC 
   using __gnu_cxx::lldiv_t;
+#endif
   using __gnu_cxx::_Exit;
   using __gnu_cxx::abs;
   using __gnu_cxx::llabs; 
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC 
   using __gnu_cxx::div;
   using __gnu_cxx::lldiv;
+#endif
   using __gnu_cxx::atoll;
   using __gnu_cxx::strtof;
   using __gnu_cxx::strtoll;