1227825Stheraven// -*- C++ -*- 2227825Stheraven//===--------------------------- cstdlib ----------------------------------===// 3227825Stheraven// 4227825Stheraven// The LLVM Compiler Infrastructure 5227825Stheraven// 6227825Stheraven// This file is dual licensed under the MIT and the University of Illinois Open 7227825Stheraven// Source Licenses. See LICENSE.TXT for details. 8227825Stheraven// 9227825Stheraven//===----------------------------------------------------------------------===// 10227825Stheraven 11227825Stheraven#ifndef _LIBCPP_CSTDLIB 12227825Stheraven#define _LIBCPP_CSTDLIB 13227825Stheraven 14227825Stheraven/* 15227825Stheraven cstdlib synopsis 16227825Stheraven 17227825StheravenMacros: 18227825Stheraven 19227825Stheraven EXIT_FAILURE 20227825Stheraven EXIT_SUCCESS 21227825Stheraven MB_CUR_MAX 22227825Stheraven NULL 23227825Stheraven RAND_MAX 24227825Stheraven 25227825Stheravennamespace std 26227825Stheraven{ 27227825Stheraven 28227825StheravenTypes: 29227825Stheraven 30227825Stheraven size_t 31227825Stheraven div_t 32227825Stheraven ldiv_t 33227825Stheraven lldiv_t // C99 34227825Stheraven 35227825Stheravendouble atof (const char* nptr); 36227825Stheravenint atoi (const char* nptr); 37227825Stheravenlong atol (const char* nptr); 38227825Stheravenlong long atoll(const char* nptr); // C99 39227825Stheravendouble strtod (const char* restrict nptr, char** restrict endptr); 40227825Stheravenfloat strtof (const char* restrict nptr, char** restrict endptr); // C99 41227825Stheravenlong double strtold (const char* restrict nptr, char** restrict endptr); // C99 42227825Stheravenlong strtol (const char* restrict nptr, char** restrict endptr, int base); 43227825Stheravenlong long strtoll (const char* restrict nptr, char** restrict endptr, int base); // C99 44227825Stheravenunsigned long strtoul (const char* restrict nptr, char** restrict endptr, int base); 45227825Stheravenunsigned long long strtoull(const char* restrict nptr, char** restrict endptr, int base); // C99 46227825Stheravenint rand(void); 47227825Stheravenvoid srand(unsigned int seed); 48227825Stheravenvoid* calloc(size_t nmemb, size_t size); 49227825Stheravenvoid free(void* ptr); 50227825Stheravenvoid* malloc(size_t size); 51227825Stheravenvoid* realloc(void* ptr, size_t size); 52227825Stheravenvoid abort(void); 53227825Stheravenint atexit(void (*func)(void)); 54227825Stheravenvoid exit(int status); 55227825Stheravenvoid _Exit(int status); 56227825Stheravenchar* getenv(const char* name); 57227825Stheravenint system(const char* string); 58227825Stheravenvoid* bsearch(const void* key, const void* base, size_t nmemb, size_t size, 59227825Stheraven int (*compar)(const void *, const void *)); 60227825Stheravenvoid qsort(void* base, size_t nmemb, size_t size, 61227825Stheraven int (*compar)(const void *, const void *)); 62227825Stheravenint abs( int j); 63227825Stheravenlong abs( long j); 64227825Stheravenlong long abs(long long j); // C++0X 65227825Stheravenlong labs( long j); 66227825Stheravenlong long llabs(long long j); // C99 67227825Stheravendiv_t div( int numer, int denom); 68227825Stheravenldiv_t div( long numer, long denom); 69227825Stheravenlldiv_t div(long long numer, long long denom); // C++0X 70227825Stheravenldiv_t ldiv( long numer, long denom); 71227825Stheravenlldiv_t lldiv(long long numer, long long denom); // C99 72227825Stheravenint mblen(const char* s, size_t n); 73227825Stheravenint mbtowc(wchar_t* restrict pwc, const char* restrict s, size_t n); 74227825Stheravenint wctomb(char* s, wchar_t wchar); 75227825Stheravensize_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n); 76227825Stheravensize_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n); 77241900Sdimint at_quick_exit(void (*func)(void)) // C++11 78241900Sdimvoid quick_exit(int status); // C++11 79241900Sdimvoid *aligned_alloc(size_t alignment, size_t size); // C11 80227825Stheraven 81227825Stheraven} // std 82227825Stheraven 83227825Stheraven*/ 84227825Stheraven 85227825Stheraven#include <__config> 86227825Stheraven#include <stdlib.h> 87227825Stheraven 88227825Stheraven#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 89227825Stheraven#pragma GCC system_header 90227825Stheraven#endif 91227825Stheraven 92227825Stheraven_LIBCPP_BEGIN_NAMESPACE_STD 93227825Stheraven 94227825Stheravenusing ::size_t; 95227825Stheravenusing ::div_t; 96227825Stheravenusing ::ldiv_t; 97243671Stheraven#ifndef _LIBCPP_HAS_NO_LONG_LONG 98227825Stheravenusing ::lldiv_t; 99243671Stheraven#endif // _LIBCPP_HAS_NO_LONG_LONG 100227825Stheravenusing ::atof; 101227825Stheravenusing ::atoi; 102227825Stheravenusing ::atol; 103243671Stheraven#ifndef _LIBCPP_HAS_NO_LONG_LONG 104227825Stheravenusing ::atoll; 105243671Stheraven#endif // _LIBCPP_HAS_NO_LONG_LONG 106227825Stheravenusing ::strtod; 107227825Stheravenusing ::strtof; 108227825Stheravenusing ::strtold; 109227825Stheravenusing ::strtol; 110243671Stheraven#ifndef _LIBCPP_HAS_NO_LONG_LONG 111227825Stheravenusing ::strtoll; 112243671Stheraven#endif // _LIBCPP_HAS_NO_LONG_LONG 113227825Stheravenusing ::strtoul; 114243671Stheraven#ifndef _LIBCPP_HAS_NO_LONG_LONG 115227825Stheravenusing ::strtoull; 116243671Stheraven#endif // _LIBCPP_HAS_NO_LONG_LONG 117227825Stheravenusing ::rand; 118227825Stheravenusing ::srand; 119227825Stheravenusing ::calloc; 120227825Stheravenusing ::free; 121227825Stheravenusing ::malloc; 122227825Stheravenusing ::realloc; 123227825Stheravenusing ::abort; 124227825Stheravenusing ::atexit; 125227825Stheravenusing ::exit; 126227825Stheravenusing ::_Exit; 127227825Stheravenusing ::getenv; 128227825Stheravenusing ::system; 129227825Stheravenusing ::bsearch; 130227825Stheravenusing ::qsort; 131227825Stheravenusing ::abs; 132227825Stheravenusing ::labs; 133243671Stheraven#ifndef _LIBCPP_HAS_NO_LONG_LONG 134227825Stheravenusing ::llabs; 135243671Stheraven#endif // _LIBCPP_HAS_NO_LONG_LONG 136227825Stheravenusing ::div; 137227825Stheravenusing ::ldiv; 138243671Stheraven#ifndef _LIBCPP_HAS_NO_LONG_LONG 139227825Stheravenusing ::lldiv; 140243671Stheraven#endif // _LIBCPP_HAS_NO_LONG_LONG 141288943Sdim#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS 142227825Stheravenusing ::mblen; 143227825Stheravenusing ::mbtowc; 144227825Stheravenusing ::wctomb; 145288943Sdim#endif 146227825Stheravenusing ::mbstowcs; 147227825Stheravenusing ::wcstombs; 148232969Stheraven#ifdef _LIBCPP_HAS_QUICK_EXIT 149232969Stheravenusing ::at_quick_exit; 150232969Stheravenusing ::quick_exit; 151232969Stheraven#endif 152241900Sdim#ifdef _LIBCPP_HAS_C11_FEATURES 153241900Sdimusing ::aligned_alloc; 154241900Sdim#endif 155227825Stheraven 156227825Stheraven_LIBCPP_END_NAMESPACE_STD 157227825Stheraven 158227825Stheraven#endif // _LIBCPP_CSTDLIB 159