diff options
Diffstat (limited to 'newlib/libc/include/stdlib.h')
-rw-r--r-- | newlib/libc/include/stdlib.h | 64 |
1 files changed, 22 insertions, 42 deletions
diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h index 9bee3b187..00a9d1ab3 100644 --- a/newlib/libc/include/stdlib.h +++ b/newlib/libc/include/stdlib.h @@ -5,6 +5,9 @@ */ #ifndef _STDLIB_H_ +#ifdef __cplusplus +extern "C" { +#endif #define _STDLIB_H_ #include "_ansi.h" @@ -14,17 +17,11 @@ #include <stddef.h> #include <sys/reent.h> -#include <machine/stdlib.h> + #ifndef __STRICT_ANSI__ #include <alloca.h> #endif -#ifdef __CYGWIN__ -#include <cygwin/stdlib.h> -#endif - -_BEGIN_STD_C - typedef struct { int quot; /* quotient */ @@ -37,14 +34,6 @@ typedef struct long rem; /* remainder */ } ldiv_t; -#ifndef __STRICT_ANSI__ -typedef struct -{ - long long int quot; /* quotient */ - long long int rem; /* remainder */ -} lldiv_t; -#endif - #ifndef NULL #define NULL 0 #endif @@ -66,9 +55,7 @@ double _EXFUN(atof,(const char *__nptr)); float _EXFUN(atoff,(const char *__nptr)); #endif int _EXFUN(atoi,(const char *__nptr)); -int _EXFUN(_atoi_r,(struct _reent *, const char *__nptr)); long _EXFUN(atol,(const char *__nptr)); -long _EXFUN(_atol_r,(struct _reent *, const char *__nptr)); _PTR _EXFUN(bsearch,(const _PTR __key, const _PTR __base, size_t __nmemb, @@ -86,15 +73,15 @@ long _EXFUN(labs,(long)); ldiv_t _EXFUN(ldiv,(long __numer, long __denom)); _PTR _EXFUN(malloc,(size_t __size)); int _EXFUN(mblen,(const char *, size_t)); -int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *)); +int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, int *)); int _EXFUN(mbtowc,(wchar_t *, const char *, size_t)); -int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *)); +int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *, const char *, size_t, int *)); int _EXFUN(wctomb,(char *, wchar_t)); -int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *)); +int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, int *)); size_t _EXFUN(mbstowcs,(wchar_t *, const char *, size_t)); -size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *)); +size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *, const char *, size_t, int *)); size_t _EXFUN(wcstombs,(char *, const wchar_t *, size_t)); -size_t _EXFUN(_wcstombs_r,(struct _reent *, char *, const wchar_t *, size_t, _mbstate_t *)); +size_t _EXFUN(_wcstombs_r,(struct _reent *, char *, const wchar_t *, size_t, int *)); #ifndef __STRICT_ANSI__ #ifndef _REENT_ONLY int _EXFUN(mkstemp,(char *)); @@ -107,12 +94,8 @@ _PTR _EXFUN(realloc,(_PTR __r, size_t __size)); _VOID _EXFUN(srand,(unsigned __seed)); double _EXFUN(strtod,(const char *__n, char **__end_PTR)); double _EXFUN(_strtod_r,(struct _reent *,const char *__n, char **__end_PTR)); -float _EXFUN(strtof,(const char *__n, char **__end_PTR)); #ifndef __STRICT_ANSI__ -/* the following strtodf interface is deprecated...use strtof instead */ -# ifndef strtodf -# define strtodf strtof -# endif +float _EXFUN(strtodf,(const char *__n, char **__end_PTR)); #endif long _EXFUN(strtol,(const char *__n, char **__end_PTR, int __base)); long _EXFUN(_strtol_r,(struct _reent *,const char *__n, char **__end_PTR, int __base)); @@ -122,13 +105,8 @@ unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__n, char **__end_P int _EXFUN(system,(const char *__string)); #ifndef __STRICT_ANSI__ -long _EXFUN(a64l,(const char *__input)); -char * _EXFUN(l64a,(long __input)); -char * _EXFUN(_l64a_r,(struct _reent *,long __input)); -int _EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg)); -_VOID _EXFUN(_Exit,(int __status) _ATTRIBUTE ((noreturn))); -int _EXFUN(putenv,(char *__string)); -int _EXFUN(_putenv_r,(struct _reent *, char *__string)); +int _EXFUN(putenv,(const char *__string)); +int _EXFUN(_putenv_r,(struct _reent *, const char *__string)); int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite)); int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite)); @@ -163,10 +141,6 @@ unsigned short * _EXFUN(_seed48_r,(struct _reent *, unsigned short [3])); _VOID _EXFUN(srand48,(long)); _VOID _EXFUN(_srand48_r,(struct _reent *, long)); -long long _EXFUN(atoll,(const char *__nptr)); -long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr)); -long long _EXFUN(llabs,(long long)); -lldiv_t _EXFUN(lldiv,(long long __numer, long long __denom)); long long _EXFUN(strtoll,(const char *__n, char **__end_PTR, int __base)); long long _EXFUN(_strtoll_r,(struct _reent *, const char *__n, char **__end_PTR, int __base)); unsigned long long _EXFUN(strtoull,(const char *__n, char **__end_PTR, int __base)); @@ -174,24 +148,30 @@ unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__n, char ** #ifndef __CYGWIN__ _VOID _EXFUN(cfree,(_PTR)); +#else +char * _EXFUN(realpath,(const char *, char *)); void _EXFUN(unsetenv,(const char *__string)); void _EXFUN(_unsetenv_r,(struct _reent *, const char *__string)); +int _EXFUN(random,(_VOID)); +long _EXFUN(srandom,(unsigned __seed)); +char * _EXFUN(ptsname, (int)); +int _EXFUN(grantpt, (int)); +int _EXFUN(unlockpt,(int)); #endif #endif /* ! __STRICT_ANSI__ */ char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**)); -#ifndef __CYGWIN__ _PTR _EXFUN(_malloc_r,(struct _reent *, size_t)); _PTR _EXFUN(_calloc_r,(struct _reent *, size_t, size_t)); _VOID _EXFUN(_free_r,(struct _reent *, _PTR)); _PTR _EXFUN(_realloc_r,(struct _reent *, _PTR, size_t)); _VOID _EXFUN(_mstats_r,(struct _reent *, char *)); -#endif int _EXFUN(_system_r,(struct _reent *, const char *)); _VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *)); -_END_STD_C - +#ifdef __cplusplus +} +#endif #endif /* _STDLIB_H_ */ |