cstdlib
Go to the documentation of this file.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
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #pragma GCC system_header
00047
00048 #include <bits/c++config.h>
00049 #include <cstddef>
00050
00051 #ifndef _GLIBCXX_CSTDLIB
00052 #define _GLIBCXX_CSTDLIB 1
00053
00054 #if !_GLIBCXX_HOSTED
00055
00056
00057
00058
00059
00060 #define EXIT_SUCCESS 0
00061 #define EXIT_FAILURE 1
00062
00063 _GLIBCXX_BEGIN_NAMESPACE(std)
00064
00065 extern "C" void abort(void);
00066 extern "C" int atexit(void (*)());
00067 extern "C" void exit(int);
00068
00069 _GLIBCXX_END_NAMESPACE
00070
00071 #else
00072
00073 #include_next <stdlib.h>
00074
00075
00076 #undef abort
00077 #undef abs
00078 #undef atexit
00079 #undef atof
00080 #undef atoi
00081 #undef atol
00082 #undef bsearch
00083 #undef calloc
00084 #undef div
00085 #undef exit
00086 #undef free
00087 #undef getenv
00088 #undef labs
00089 #undef ldiv
00090 #undef malloc
00091 #undef mblen
00092 #undef mbstowcs
00093 #undef mbtowc
00094 #undef qsort
00095 #undef rand
00096 #undef realloc
00097 #undef srand
00098 #undef strtod
00099 #undef strtol
00100 #undef strtoul
00101 #undef system
00102 #undef wcstombs
00103 #undef wctomb
00104
00105 _GLIBCXX_BEGIN_NAMESPACE(std)
00106
00107 using ::div_t;
00108 using ::ldiv_t;
00109
00110 using ::abort;
00111 using ::abs;
00112 using ::atexit;
00113 using ::atof;
00114 using ::atoi;
00115 using ::atol;
00116 using ::bsearch;
00117 using ::calloc;
00118 using ::div;
00119 using ::exit;
00120 using ::free;
00121 using ::getenv;
00122 using ::labs;
00123 using ::ldiv;
00124 using ::malloc;
00125 #ifdef _GLIBCXX_HAVE_MBSTATE_T
00126 using ::mblen;
00127 using ::mbstowcs;
00128 using ::mbtowc;
00129 #endif // _GLIBCXX_HAVE_MBSTATE_T
00130 using ::qsort;
00131 using ::rand;
00132 using ::realloc;
00133 using ::srand;
00134 using ::strtod;
00135 using ::strtol;
00136 using ::strtoul;
00137 using ::system;
00138 #ifdef _GLIBCXX_USE_WCHAR_T
00139 using ::wcstombs;
00140 using ::wctomb;
00141 #endif // _GLIBCXX_USE_WCHAR_T
00142
00143 inline long
00144 abs(long __i) { return labs(__i); }
00145
00146 inline ldiv_t
00147 div(long __i, long __j) { return ldiv(__i, __j); }
00148
00149 _GLIBCXX_END_NAMESPACE
00150
00151 #if _GLIBCXX_USE_C99
00152
00153 #undef _Exit
00154 #undef llabs
00155 #undef lldiv
00156 #undef atoll
00157 #undef strtoll
00158 #undef strtoull
00159 #undef strtof
00160 #undef strtold
00161
00162 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
00163
00164 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00165 using ::lldiv_t;
00166 #endif
00167 #if _GLIBCXX_USE_C99_CHECK || _GLIBCXX_USE_C99_DYNAMIC
00168 extern "C" void (_Exit)(int);
00169 #endif
00170 #if !_GLIBCXX_USE_C99_DYNAMIC
00171 using ::_Exit;
00172 #endif
00173
00174 inline long long
00175 abs(long long __x) { return __x >= 0 ? __x : -__x; }
00176
00177 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00178 using ::llabs;
00179
00180 inline lldiv_t
00181 div(long long __n, long long __d)
00182 { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
00183
00184 using ::lldiv;
00185 #endif
00186
00187 #if _GLIBCXX_USE_C99_LONG_LONG_CHECK || _GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00188 extern "C" long long int (atoll)(const char *);
00189 extern "C" long long int
00190 (strtoll)(const char * restrict, char ** restrict, int);
00191 extern "C" unsigned long long int
00192 (strtoull)(const char * restrict, char ** restrict, int);
00193 #endif
00194 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00195 using ::atoll;
00196 using ::strtoll;
00197 using ::strtoull;
00198 #endif
00199 using ::strtof;
00200 using ::strtold;
00201
00202 _GLIBCXX_END_NAMESPACE
00203
00204 _GLIBCXX_BEGIN_NAMESPACE(std)
00205
00206 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00207 using ::__gnu_cxx::lldiv_t;
00208 #endif
00209 using ::__gnu_cxx::_Exit;
00210 using ::__gnu_cxx::abs;
00211 #if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
00212 using ::__gnu_cxx::llabs;
00213 using ::__gnu_cxx::div;
00214 using ::__gnu_cxx::lldiv;
00215 #endif
00216 using ::__gnu_cxx::atoll;
00217 using ::__gnu_cxx::strtof;
00218 using ::__gnu_cxx::strtoll;
00219 using ::__gnu_cxx::strtoull;
00220 using ::__gnu_cxx::strtold;
00221
00222 _GLIBCXX_END_NAMESPACE
00223
00224 #endif // _GLIBCXX_USE_C99
00225
00226 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00227 # if defined(_GLIBCXX_INCLUDE_AS_TR1)
00228 # error C++0x header cannot be included from TR1 header
00229 # endif
00230 # if defined(_GLIBCXX_INCLUDE_AS_CXX0X)
00231 # include <tr1_impl/cstdlib>
00232 # else
00233 # define _GLIBCXX_INCLUDE_AS_CXX0X
00234 # define _GLIBCXX_BEGIN_NAMESPACE_TR1
00235 # define _GLIBCXX_END_NAMESPACE_TR1
00236 # define _GLIBCXX_TR1
00237 # include <tr1_impl/cstdlib>
00238 # undef _GLIBCXX_TR1
00239 # undef _GLIBCXX_END_NAMESPACE_TR1
00240 # undef _GLIBCXX_BEGIN_NAMESPACE_TR1
00241 # undef _GLIBCXX_INCLUDE_AS_CXX0X
00242 # endif
00243 #endif
00244
00245 #endif // !_GLIBCXX_HOSTED
00246
00247 #endif