00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00045 #ifndef _GLIBCXX_CSTDLIB
00046 #define _GLIBCXX_CSTDLIB 1
00047
00048 #pragma GCC system_header
00049
00050 #include <bits/c++config.h>
00051 #include <cstddef>
00052
00053 #if !_GLIBCXX_HOSTED
00054
00055
00056
00057
00058
00059 #define EXIT_SUCCESS 0
00060 #define EXIT_FAILURE 1
00061
00062 namespace std
00063 {
00064 extern "C" void abort(void);
00065 extern "C" int atexit(void (*)());
00066 extern "C" void exit(int);
00067 }
00068
00069 #else
00070
00071 #include <stdlib.h>
00072
00073
00074 #undef abort
00075 #undef abs
00076 #undef atexit
00077 #undef atof
00078 #undef atoi
00079 #undef atol
00080 #undef bsearch
00081 #undef calloc
00082 #undef div
00083 #undef exit
00084 #undef free
00085 #undef getenv
00086 #undef labs
00087 #undef ldiv
00088 #undef malloc
00089 #undef mblen
00090 #undef mbstowcs
00091 #undef mbtowc
00092 #undef qsort
00093 #undef rand
00094 #undef realloc
00095 #undef srand
00096 #undef strtod
00097 #undef strtol
00098 #undef strtoul
00099 #undef system
00100 #undef wcstombs
00101 #undef wctomb
00102
00103 namespace std
00104 {
00105 using ::div_t;
00106 using ::ldiv_t;
00107
00108 using ::abort;
00109 using ::abs;
00110 using ::atexit;
00111 using ::atof;
00112 using ::atoi;
00113 using ::atol;
00114 using ::bsearch;
00115 using ::calloc;
00116 using ::div;
00117 using ::exit;
00118 using ::free;
00119 using ::getenv;
00120 using ::labs;
00121 using ::ldiv;
00122 using ::malloc;
00123 #ifdef _GLIBCXX_HAVE_MBSTATE_T
00124 using ::mblen;
00125 using ::mbstowcs;
00126 using ::mbtowc;
00127 #endif // _GLIBCXX_HAVE_MBSTATE_T
00128 using ::qsort;
00129 using ::rand;
00130 using ::realloc;
00131 using ::srand;
00132 using ::strtod;
00133 using ::strtol;
00134 using ::strtoul;
00135 using ::system;
00136 #ifdef _GLIBCXX_USE_WCHAR_T
00137 using ::wcstombs;
00138 using ::wctomb;
00139 #endif // _GLIBCXX_USE_WCHAR_T
00140
00141 inline long
00142 abs(long __i) { return labs(__i); }
00143
00144 inline ldiv_t
00145 div(long __i, long __j) { return ldiv(__i, __j); }
00146 }
00147
00148 #if _GLIBCXX_USE_C99
00149
00150 #undef _Exit
00151 #undef llabs
00152 #undef lldiv
00153 #undef atoll
00154 #undef strtoll
00155 #undef strtoull
00156 #undef strtof
00157 #undef strtold
00158
00159 namespace __gnu_cxx
00160 {
00161 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00162 using ::lldiv_t;
00163 #endif
00164 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
00165 extern "C" void (_Exit)(int);
00166 #endif
00167 #if !_GLIBCXX_USE_C99_DYNAMIC
00168 using ::_Exit;
00169 #endif
00170
00171 inline long long
00172 abs(long long __x) { return __x >= 0 ? __x : -__x; }
00173
00174 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00175 using ::llabs;
00176
00177 inline lldiv_t
00178 div(long long __n, long long __d)
00179 { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
00180
00181 using ::lldiv;
00182 #endif
00183
00184 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00185 extern "C" long long int (atoll)(const char *);
00186 extern "C" long long int
00187 (strtoll)(const char * restrict, char ** restrict, int);
00188 extern "C" unsigned long long int
00189 (strtoull)(const char * restrict, char ** restrict, int);
00190 #endif
00191 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00192 using ::atoll;
00193 using ::strtoll;
00194 using ::strtoull;
00195 #endif
00196 using ::strtof;
00197 using ::strtold;
00198 }
00199
00200 namespace std
00201 {
00202 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00203 using ::__gnu_cxx::lldiv_t;
00204 #endif
00205 using ::__gnu_cxx::_Exit;
00206 using ::__gnu_cxx::abs;
00207 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00208 using ::__gnu_cxx::llabs;
00209 using ::__gnu_cxx::div;
00210 using ::__gnu_cxx::lldiv;
00211 #endif
00212 using ::__gnu_cxx::atoll;
00213 using ::__gnu_cxx::strtof;
00214 using ::__gnu_cxx::strtoll;
00215 using ::__gnu_cxx::strtoull;
00216 using ::__gnu_cxx::strtold;
00217 }
00218
00219 #endif // _GLIBCXX_USE_C99
00220
00221 #endif // !_GLIBCXX_HOSTED
00222
00223 #endif