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