X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=include%2Fstdlib.h;h=86cf017165440824f719b7508fe3971f6274a05d;hp=0a8de8662195ae0dadcc176609c30751cb6aa742;hb=0c05bd3a9c165cf2f0b9d6fa23a1f96532ddcdb3;hpb=3b94daba711090f1936f59fae6f7cbcba963b29e diff --git a/include/stdlib.h b/include/stdlib.h index 0a8de866..86cf0171 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -5,6 +5,19 @@ extern "C" { #endif +#if __STDC_VERSION__ >= 199901L +#define __restrict restrict +#elif !defined(__GNUC__) +#define __restrict +#endif + +#if __STDC_VERSION__ >= 201112L +#elif defined(__GNUC__) +#define _Noreturn __attribute__((__noreturn__)) +#else +#define _Noreturn +#endif + #undef NULL #ifdef __cplusplus #define NULL 0 @@ -22,14 +35,14 @@ long atol (const char *); long long atoll (const char *); double atof (const char *); -float strtof (const char *, char **); -double strtod (const char *, char **); -long double strtold (const char *, char **); +float strtof (const char *__restrict, char **__restrict); +double strtod (const char *__restrict, char **__restrict); +long double strtold (const char *__restrict, char **__restrict); -long strtol (const char *, char **, int); -unsigned long strtoul (const char *, char **, int); -long long strtoll (const char *, char **, int); -unsigned long long strtoull (const char *, char **, int); +long strtol (const char *__restrict, char **__restrict, int); +unsigned long strtoul (const char *__restrict, char **__restrict, int); +long long strtoll (const char *__restrict, char **__restrict, int); +unsigned long long strtoull (const char *__restrict, char **__restrict, int); int rand (void); void srand (unsigned); @@ -38,11 +51,14 @@ void *malloc (size_t); void *calloc (size_t, size_t); void *realloc (void *, size_t); void free (void *); +void *aligned_alloc(size_t alignment, size_t size); -void abort (void); +_Noreturn void abort (void); int atexit (void (*) (void)); -void exit (int); -void _Exit (int); +_Noreturn void exit (int); +_Noreturn void _Exit (int); +int at_quick_exit (void (*) (void)); +_Noreturn void quick_exit (int); char *getenv (const char *); @@ -64,10 +80,10 @@ ldiv_t ldiv (long, long); lldiv_t lldiv (long long, long long); int mblen (const char *, size_t); -int mbtowc (wchar_t *, const char *, size_t); +int mbtowc (wchar_t *__restrict, const char *__restrict, size_t); int wctomb (char *, wchar_t); -size_t mbstowcs (wchar_t *, const char *, size_t); -size_t wcstombs (char *, const wchar_t *, size_t); +size_t mbstowcs (wchar_t *__restrict, const char *__restrict, size_t); +size_t wcstombs (char *__restrict, const wchar_t *__restrict, size_t); #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 @@ -105,7 +121,7 @@ int rand_r (unsigned *); #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) -char *realpath (const char *, char *); +char *realpath (const char *__restrict, char *__restrict); long int random (void); void srandom (unsigned int); char *initstate (unsigned int, char *, size_t);