#ifndef _INC_STDLIB
#define _INC_STDLIB
-#include <_mingw.h>
+#include <crtdefs.h>
#include <limits.h>
#pragma pack(push,_CRT_PACKING)
typedef void (__cdecl *_purecall_handler)(void);
_CRTIMP _purecall_handler __cdecl _set_purecall_handler(_purecall_handler _Handler);
- _CRTIMP _purecall_handler __cdecl _get_purecall_handler();
+ _CRTIMP _purecall_handler __cdecl _get_purecall_handler(void);
typedef void (__cdecl *_invalid_parameter_handler)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t);
_invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler _Handler);
errno_t __cdecl _set_doserrno(unsigned long _Value);
errno_t __cdecl _get_doserrno(unsigned long *_Value);
-#ifdef _MSVCRT_
- extern int* _imp___sys_nerr;
- extern char*** _imp__sys_errlist;
-#else
- __MINGW_IMPORT int _sys_nerr;
- __MINGW_IMPORT char* _sys_errlist[];
-#endif
+ _CRTIMP extern char *_sys_errlist[];
+ _CRTIMP extern int _sys_nerr;
-//#if (defined(_X86_) && !defined(__x86_64))
+//#if !defined(__x86_64)
_CRTIMP int *__cdecl __p___argc(void);
_CRTIMP char ***__cdecl __p___argv(void);
_CRTIMP wchar_t ***__cdecl __p___wargv(void);
#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
#else
extern "C++" {
- template <typename _CountofType,size_t _SizeOfArray> char (*__countof_helper(UNALIGNED _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
+ template <typename _CountofType,size_t _SizeOfArray>
+ char (*__countof_helper(/*UNALIGNED*/ _CountofType (&_Array)[_SizeOfArray]))[_SizeOfArray];
#define _countof(_Array) sizeof(*__countof_helper(_Array))
}
#endif
_CRTIMP __declspec(noreturn) void __cdecl _exit(int _Code);
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
/* C99 function name */
- void __cdecl __declspec(noreturn) _Exit(int); /* Declare to get noreturn attribute. */
+ __declspec(noreturn) void __cdecl _Exit(int); /* Declare to get noreturn attribute. */
__CRT_INLINE void __cdecl _Exit(int status)
{ _exit(status); }
#endif
#pragma push_macro("abort")
#undef abort
#endif
- void __cdecl __declspec(noreturn) abort(void);
+ __declspec(noreturn) void __cdecl abort(void);
#if __MINGW_GNUC_PREREQ(4,4)
#pragma pop_macro("abort")
#endif
#endif
#if _INTEGRAL_MAX_BITS >= 64
- __int64 __cdecl _abs64(__int64);
+ __MINGW_EXTENSION __int64 __cdecl _abs64(__int64);
#endif
int __cdecl atexit(void (__cdecl *)(void));
#ifndef _CRT_ATOF_DEFINED
void *__cdecl bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
void __cdecl qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
#endif
- /*unsigned short __cdecl _byteswap_ushort(unsigned short _Short); */
+ unsigned short __cdecl _byteswap_ushort(unsigned short _Short);
/*unsigned long __cdecl _byteswap_ulong (unsigned long _Long); */
#if _INTEGRAL_MAX_BITS >= 64
- /*unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 _Int64);*/
+ __MINGW_EXTENSION unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 _Int64);
#endif
div_t __cdecl div(int _Numerator,int _Denominator);
char *__cdecl getenv(const char *_VarName);
_CRTIMP char *__cdecl _itoa(int _Value,char *_Dest,int _Radix);
-/* #if _INTEGRAL_MAX_BITS >= 64 */
- _CRTIMP char *__cdecl _i64toa(__int64 _Val,char *_DstBuf,int _Radix);
- _CRTIMP char *__cdecl _ui64toa(unsigned __int64 _Val,char *_DstBuf,int _Radix);
- _CRTIMP __int64 __cdecl _atoi64(const char *_String);
- _CRTIMP __int64 __cdecl _atoi64_l(const char *_String,_locale_t _Locale);
- _CRTIMP __int64 __cdecl _strtoi64(const char *_String,char **_EndPtr,int _Radix);
- _CRTIMP __int64 __cdecl _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
- _CRTIMP unsigned __int64 __cdecl _strtoui64(const char *_String,char **_EndPtr,int _Radix);
- _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
-/* #endif */
+#if _INTEGRAL_MAX_BITS >= 64
+ __MINGW_EXTENSION _CRTIMP char *__cdecl _i64toa(__int64 _Val,char *_DstBuf,int _Radix);
+ __MINGW_EXTENSION _CRTIMP char *__cdecl _ui64toa(unsigned __int64 _Val,char *_DstBuf,int _Radix);
+ __MINGW_EXTENSION _CRTIMP __int64 __cdecl _atoi64(const char *_String);
+ __MINGW_EXTENSION _CRTIMP __int64 __cdecl _atoi64_l(const char *_String,_locale_t _Locale);
+ __MINGW_EXTENSION _CRTIMP __int64 __cdecl _strtoi64(const char *_String,char **_EndPtr,int _Radix);
+ __MINGW_EXTENSION _CRTIMP __int64 __cdecl _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
+ __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _strtoui64(const char *_String,char **_EndPtr,int _Radix);
+ __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
+#endif
ldiv_t __cdecl ldiv(long _Numerator,long _Denominator);
_CRTIMP char *__cdecl _ltoa(long _Value,char *_Dest,int _Radix);
int __cdecl mblen(const char *_Ch,size_t _MaxCount);
_CRTIMP long __cdecl _wtol(const wchar_t *_Str);
_CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
-/* #if _INTEGRAL_MAX_BITS >= 64 */
- _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix);
- _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
- _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
- _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale);
- _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
- _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
- _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
- _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
-/* #endif */
+#if _INTEGRAL_MAX_BITS >= 64
+ __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix);
+ __MINGW_EXTENSION _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
+ __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
+ __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wtoi64_l(const wchar_t *_Str,_locale_t _Locale);
+ __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
+ __MINGW_EXTENSION _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
+ __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
+ __MINGW_EXTENSION _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
+#endif
#endif
#ifndef _POSIX_
_CRTIMP int __cdecl _atodbl_l(_CRT_DOUBLE *_Result,char *_Str,_locale_t _Locale);
_CRTIMP int __cdecl _atoldbl_l(_LDOUBLE *_Result,char *_Str,_locale_t _Locale);
_CRTIMP int __cdecl _atoflt_l(_CRT_FLOAT *_Result,char *_Str,_locale_t _Locale);
- _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotl(unsigned long, int) __MINGW_ATTRIB_CONST;
- _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotr(unsigned long, int) __MINGW_ATTRIB_CONST;
+ unsigned long __cdecl _lrotl(unsigned long _Val,int _Shift);
+ unsigned long __cdecl _lrotr(unsigned long _Val,int _Shift);
_CRTIMP void __cdecl _makepath(char *_Path,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext);
_onexit_t __cdecl _onexit(_onexit_t _Func);
void __cdecl perror(const char *_ErrMsg);
#endif
_CRTIMP int __cdecl _putenv(const char *_EnvString);
- //_CRTIMP unsigned int __cdecl _rotl(unsigned int, int) __MINGW_ATTRIB_CONST;
+ unsigned int __cdecl _rotl(unsigned int _Val,int _Shift);
#if _INTEGRAL_MAX_BITS >= 64
- //_CRTIMP unsigned __int64 __cdecl _rotl64(unsigned __int64, int) __MINGW_ATTRIB_CONST;
+ __MINGW_EXTENSION unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val,int _Shift);
#endif
- //_CRTIMP unsigned int __cdecl _rotr(unsigned int, int) __MINGW_ATTRIB_CONST;
+ unsigned int __cdecl _rotr(unsigned int _Val,int _Shift);
#if _INTEGRAL_MAX_BITS >= 64
- //_CRTIMP unsigned __int64 __cdecl _rotr64(unsigned __int64, int) __MINGW_ATTRIB_CONST;
+ __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift);
#endif
_CRTIMP void __cdecl _searchenv(const char *_Filename,const char *_EnvVar,char *_ResultPath);
_CRTIMP void __cdecl _splitpath(const char *_FullPath,char *_Drive,char *_Dir,char *_Filename,char *_Ext);
#endif
#endif
-#define sys_errlist (*_imp___sys_errlist)
-#define sys_nerr (*_imp___sys_nerr)
+#define sys_errlist _sys_errlist
+#define sys_nerr _sys_nerr
#define environ _environ
- char *__cdecl ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign);
- char *__cdecl fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign);
- char *__cdecl gcvt(double _Val,int _NumOfDigits,char *_DstBuf);
- char *__cdecl itoa(int _Val,char *_DstBuf,int _Radix);
- char *__cdecl ltoa(long _Val,char *_DstBuf,int _Radix);
- int __cdecl putenv(const char *_EnvString);
- void __cdecl swab(char *_Buf1,char *_Buf2,int _SizeInBytes);
- char *__cdecl ultoa(unsigned long _Val,char *_Dstbuf,int _Radix);
- onexit_t __cdecl onexit(onexit_t _Func);
+ _CRTIMP char *__cdecl ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign);
+ _CRTIMP char *__cdecl fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign);
+ _CRTIMP char *__cdecl gcvt(double _Val,int _NumOfDigits,char *_DstBuf);
+ _CRTIMP char *__cdecl itoa(int _Val,char *_DstBuf,int _Radix);
+ _CRTIMP char *__cdecl ltoa(long _Val,char *_DstBuf,int _Radix);
+ _CRTIMP int __cdecl putenv(const char *_EnvString);
+ _CRTIMP void __cdecl swab(char *_Buf1,char *_Buf2,int _SizeInBytes);
+ _CRTIMP char *__cdecl ultoa(unsigned long _Val,char *_Dstbuf,int _Radix);
+ _CRTIMP onexit_t __cdecl onexit(onexit_t _Func);
#endif
#endif
#if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
- typedef struct { long long quot, rem; } lldiv_t;
+ __MINGW_EXTENSION typedef struct { long long quot, rem; } lldiv_t;
- lldiv_t __cdecl lldiv(long long, long long);
+ __MINGW_EXTENSION lldiv_t __cdecl lldiv(long long, long long);
- __CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }
+ __MINGW_EXTENSION __CRT_INLINE long long __cdecl llabs(long long _j) { return (_j >= 0 ? _j : -_j); }
- long long __cdecl strtoll(const char* __restrict__, char** __restrict, int);
- unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int);
+ __MINGW_EXTENSION long long __cdecl strtoll(const char* __restrict__, char** __restrict, int);
+ __MINGW_EXTENSION unsigned long long __cdecl strtoull(const char* __restrict__, char** __restrict__, int);
/* these are stubs for MS _i64 versions */
- long long __cdecl atoll (const char *);
+ __MINGW_EXTENSION long long __cdecl atoll (const char *);
#ifndef __STRICT_ANSI__
- long long __cdecl wtoll (const wchar_t *);
- char *__cdecl lltoa (long long, char *, int);
- char *__cdecl ulltoa (unsigned long long , char *, int);
- wchar_t *__cdecl lltow (long long, wchar_t *, int);
- wchar_t *__cdecl ulltow (unsigned long long, wchar_t *, int);
-#if _INTEGRAL_MAX_BITS >= 64
+ __MINGW_EXTENSION long long __cdecl wtoll (const wchar_t *);
+ __MINGW_EXTENSION char *__cdecl lltoa (long long, char *, int);
+ __MINGW_EXTENSION char *__cdecl ulltoa (unsigned long long , char *, int);
+ __MINGW_EXTENSION wchar_t *__cdecl lltow (long long, wchar_t *, int);
+ __MINGW_EXTENSION wchar_t *__cdecl ulltow (unsigned long long, wchar_t *, int);
+
/* __CRT_INLINE using non-ansi functions */
- __CRT_INLINE long long __cdecl atoll (const char * _c) { return _atoi64 (_c); }
- __CRT_INLINE char *__cdecl lltoa (long long _n, char * _c, int _i) { return _i64toa (_n, _c, _i); }
- __CRT_INLINE char *__cdecl ulltoa (unsigned long long _n, char * _c, int _i) { return _ui64toa (_n, _c, _i); }
- __CRT_INLINE long long __cdecl wtoll (const wchar_t * _w) { return _wtoi64 (_w); }
- __CRT_INLINE wchar_t *__cdecl lltow (long long _n, wchar_t * _w, int _i) { return _i64tow (_n, _w, _i); }
- __CRT_INLINE wchar_t *__cdecl ulltow (unsigned long long _n, wchar_t * _w, int _i) { return _ui64tow (_n, _w, _i); }
+ __MINGW_EXTENSION __CRT_INLINE long long __cdecl atoll (const char * _c) { return _atoi64 (_c); }
+ __MINGW_EXTENSION __CRT_INLINE char *__cdecl lltoa (long long _n, char * _c, int _i) { return _i64toa (_n, _c, _i); }
+ __MINGW_EXTENSION __CRT_INLINE char *__cdecl ulltoa (unsigned long long _n, char * _c, int _i) { return _ui64toa (_n, _c, _i); }
+ __MINGW_EXTENSION __CRT_INLINE long long __cdecl wtoll (const wchar_t * _w) { return _wtoi64 (_w); }
+ __MINGW_EXTENSION __CRT_INLINE wchar_t *__cdecl lltow (long long _n, wchar_t * _w, int _i) { return _i64tow (_n, _w, _i); }
+ __MINGW_EXTENSION __CRT_INLINE wchar_t *__cdecl ulltow (unsigned long long _n, wchar_t * _w, int _i) { return _ui64tow (_n, _w, _i); }
#endif /* (__STRICT_ANSI__) */
-#endif
+
#endif /* !__NO_ISOCEXT */
#ifdef __cplusplus
#pragma pack(pop)
#include <sec_api/stdlib_s.h>
-#include <malloc.h>
-
#endif