2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
12 #pragma pack(push,_CRT_PACKING)
26 #define NULL ((void *)0)
34 #define EXIT_SUCCESS 0
35 #define EXIT_FAILURE 1
37 #ifndef _ONEXIT_T_DEFINED
38 #define _ONEXIT_T_DEFINED
40 typedef int (__cdecl
*_onexit_t
)(void);
43 #define onexit_t _onexit_t
47 #ifndef _DIV_T_DEFINED
48 #define _DIV_T_DEFINED
50 typedef struct _div_t
{
55 typedef struct _ldiv_t
{
61 #ifndef _CRT_DOUBLE_DEC
62 #define _CRT_DOUBLE_DEC
70 #define _PTR_LD(x) ((unsigned char *)(&(x)->ld))
79 #if __MINGW_GNUC_PREREQ(4,4)
80 #pragma push_macro("long")
88 #if __MINGW_GNUC_PREREQ(4,4)
89 #pragma pop_macro("long")
94 unsigned char ld12
[12];
99 #define RAND_MAX 0x7fff
102 #define MB_CUR_MAX ___mb_cur_max_func()
104 _CRTIMP
int* __cdecl
__p___mb_cur_max();
105 #define __mb_cur_max (*__p___mb_cur_max())
106 #else /* !_M_CEE_PURE */
107 _CRTIMP
extern int __mb_cur_max
;
108 #endif /* !_M_CEE_PURE */
109 _CRTIMP
int __cdecl
___mb_cur_max_func(void);
110 _CRTIMP
int __cdecl
___mb_cur_max_l_func(_locale_t
);
111 #endif /* !MB_CUR_MAX */
113 #define __max(a,b) (((a) > (b)) ? (a) : (b))
114 #define __min(a,b) (((a) < (b)) ? (a) : (b))
116 #define _MAX_PATH 260
119 #define _MAX_FNAME 256
122 #define _OUT_TO_DEFAULT 0
123 #define _OUT_TO_STDERR 1
124 #define _OUT_TO_MSGBOX 2
125 #define _REPORT_ERRMODE 3
127 #define _WRITE_ABORT_MSG 0x1
128 #define _CALL_REPORTFAULT 0x2
130 #define _MAX_ENV 32767
132 typedef void (__cdecl
*_purecall_handler
)(void);
134 _CRTIMP _purecall_handler __cdecl
_set_purecall_handler(_In_opt_ _purecall_handler _Handler
);
135 _CRTIMP _purecall_handler __cdecl
_get_purecall_handler(void);
137 typedef void (__cdecl
*_invalid_parameter_handler
)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t);
138 _invalid_parameter_handler __cdecl
_set_invalid_parameter_handler(_In_opt_ _invalid_parameter_handler _Handler
);
139 _invalid_parameter_handler __cdecl
_get_invalid_parameter_handler(void);
142 _CRTIMP
unsigned long *__cdecl
__doserrno(void);
143 #define _doserrno (*__doserrno())
144 errno_t __cdecl
_set_doserrno(_In_
unsigned long _Value
);
145 errno_t __cdecl
_get_doserrno(_Out_
unsigned long *_Value
);
147 _CRTIMP
extern char *_sys_errlist
[];
148 _CRTIMP
extern int _sys_nerr
;
150 #if defined(_DLL) && defined(_M_IX86)
151 _CRTIMP
int *__cdecl
__p___argc(void);
152 _CRTIMP
char ***__cdecl
__p___argv(void);
153 _CRTIMP
wchar_t ***__cdecl
__p___wargv(void);
154 _CRTIMP
char ***__cdecl
__p__environ(void);
155 _CRTIMP
wchar_t ***__cdecl
__p__wenviron(void);
156 _CRTIMP
char **__cdecl
__p__pgmptr(void);
157 _CRTIMP
wchar_t **__cdecl
__p__wpgmptr(void);
160 // FIXME: move inside _M_CEE_PURE section
161 _CRTIMP
int *__cdecl
__p___argc();
162 _CRTIMP
char ***__cdecl
__p___argv();
163 _CRTIMP
wchar_t ***__cdecl
__p___wargv();
164 _CRTIMP
char ***__cdecl
__p__environ();
165 _CRTIMP
wchar_t ***__cdecl
__p__wenviron();
166 _CRTIMP
char **__cdecl
__p__pgmptr();
167 _CRTIMP
wchar_t **__cdecl
__p__wpgmptr();
170 #define __argv (*__p___argv())
171 #define __argc (*__p___argc())
172 #define __wargv (*__p___wargv())
173 #define _environ (*__p__environ())
174 #define _wenviron (*__p__wenviron())
175 #define _pgmptr (*__p__pgmptr())
176 #define _wpgmptr (*__p__wpgmptr())
177 #else /* !_M_CEE_PURE */
178 _CRTIMP
extern int __argc
;
179 _CRTIMP
extern char **__argv
;
180 _CRTIMP
extern wchar_t **__wargv
;
181 _CRTIMP
extern char **_environ
;
182 _CRTIMP
extern wchar_t **_wenviron
;
183 _CRTIMP
extern char *_pgmptr
;
184 _CRTIMP
extern wchar_t *_wpgmptr
;
185 #endif /* !_M_CEE_PURE */
187 _CRTIMP errno_t __cdecl
_get_environ(_Out_
char***);
188 _CRTIMP errno_t __cdecl
_get_wenviron(_Out_
wchar_t***);
189 _CRTIMP errno_t __cdecl
_get_pgmptr(_Outptr_result_z_
char **_Value
);
190 _CRTIMP errno_t __cdecl
_get_wpgmptr(_Outptr_result_z_
wchar_t **_Value
);
193 _CRTIMP
int* __cdecl
__p__fmode();
194 #define _fmode (*__p__fmode())
196 _CRTIMP
extern int _fmode
;
197 #endif /* !_M_CEE_PURE */
198 _CRTIMP errno_t __cdecl
_set_fmode(_In_
int _Mode
);
199 _CRTIMP errno_t __cdecl
_get_fmode(_Out_
int *_PMode
);
202 _CRTIMP
unsigned int* __cdecl
__p__osplatform();
203 _CRTIMP
unsigned int* __cdecl
__p__osver();
204 _CRTIMP
unsigned int* __cdecl
__p__winver();
205 _CRTIMP
unsigned int* __cdecl
__p__winmajor();
206 _CRTIMP
unsigned int* __cdecl
__p__winminor();
207 #define _osplatform (*__p__osplatform())
208 #define _osver (*__p__osver())
209 #define _winver (*__p__winver())
210 #define _winmajor (*__p__winmajor())
211 #define _winminor (*__p__winminor())
212 #else /* !_M_CEE_PURE */
213 _CRTIMP
extern unsigned int _osplatform
;
214 _CRTIMP
extern unsigned int _osver
;
215 _CRTIMP
extern unsigned int _winver
;
216 _CRTIMP
extern unsigned int _winmajor
;
217 _CRTIMP
extern unsigned int _winminor
;
218 #endif /* !_M_CEE_PURE */
220 errno_t __cdecl
_get_osplatform(_Out_
unsigned int *_Value
);
221 errno_t __cdecl
_get_osver(_Out_
unsigned int *_Value
);
222 errno_t __cdecl
_get_winver(_Out_
unsigned int *_Value
);
223 errno_t __cdecl
_get_winmajor(_Out_
unsigned int *_Value
);
224 errno_t __cdecl
_get_winminor(_Out_
unsigned int *_Value
);
228 #define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
231 template <typename _CountofType
,size_t _SizeOfArray
>
232 char (*__countof_helper(/*UNALIGNED*/ _CountofType (&_Array
)[_SizeOfArray
]))[_SizeOfArray
];
233 #define _countof(_Array) sizeof(*__countof_helper(_Array))
238 #ifndef _CRT_TERMINATE_DEFINED
239 #define _CRT_TERMINATE_DEFINED
240 __declspec(noreturn
) void __cdecl
exit(_In_
int _Code
);
241 _CRTIMP
__declspec(noreturn
) void __cdecl
_exit(_In_
int _Code
);
242 #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
243 /* C99 function name */
244 __declspec(noreturn
) void __cdecl
_Exit(int); /* Declare to get noreturn attribute. */
245 __CRT_INLINE
void __cdecl
_Exit(int status
)
248 #if __MINGW_GNUC_PREREQ(4,4)
249 #pragma push_macro("abort")
252 __declspec(noreturn
) void __cdecl
abort(void);
253 #if __MINGW_GNUC_PREREQ(4,4)
254 #pragma pop_macro("abort")
258 _CRTIMP
unsigned int __cdecl
_set_abort_behavior(_In_
unsigned int _Flags
, _In_
unsigned int _Mask
);
260 #ifndef _CRT_ABS_DEFINED
261 #define _CRT_ABS_DEFINED
262 int __cdecl
abs(_In_
int _X
);
263 long __cdecl
labs(_In_
long _X
);
266 #if _INTEGRAL_MAX_BITS >= 64
267 __MINGW_EXTENSION __int64 __cdecl
_abs64(__int64
);
269 int __cdecl
atexit(void (__cdecl
*)(void));
271 #ifndef _CRT_ATOF_DEFINED
272 #define _CRT_ATOF_DEFINED
278 _In_z_
const char *_String
);
284 _In_z_
const char *_String
,
285 _In_opt_ _locale_t _Locale
);
287 #endif /* _CRT_ATOF_DEFINED */
293 _In_z_
const char *_Str
);
300 _In_z_
const char *_Str
,
301 _In_opt_ _locale_t _Locale
);
307 _In_z_
const char *_Str
);
314 _In_z_
const char *_Str
,
315 _In_opt_ _locale_t _Locale
);
317 #ifndef _CRT_ALGO_DEFINED
318 #define _CRT_ALGO_DEFINED
324 _In_
const void *_Key
,
325 _In_reads_bytes_(_NumOfElements
* _SizeOfElements
) const void *_Base
,
326 _In_
size_t _NumOfElements
,
327 _In_
size_t _SizeOfElements
,
328 _In_
int (__cdecl
*_PtFuncCompare
)(const void *,const void *));
333 _Inout_updates_bytes_(_NumOfElements
* _SizeOfElements
) _Post_readable_byte_size_(_NumOfElements
* _SizeOfElements
) void *_Base
,
334 _In_
size_t _NumOfElements
,
335 _In_
size_t _SizeOfElements
,
336 _In_
int (__cdecl
*_PtFuncCompare
)(const void *,const void *));
338 #endif /* _CRT_ALGO_DEFINED */
340 #if !defined(__GNUC__) && !defined(__clang__)
346 _In_
unsigned short _Short
);
352 _In_
unsigned long _Long
);
354 #if _INTEGRAL_MAX_BITS >= 64
360 _In_
unsigned __int64 _Int64
);
363 #endif /* !defined(__GNUC__) && !defined(__clang__) */
370 _In_
int _Denominator
);
376 _In_z_
const char *_VarName
);
383 _Pre_notnull_ _Post_z_
char *_Dest
,
386 #if _INTEGRAL_MAX_BITS >= 64
394 _Pre_notnull_ _Post_z_
char *_DstBuf
,
402 _In_
unsigned __int64 _Val
,
403 _Pre_notnull_ _Post_z_
char *_DstBuf
,
412 _In_z_
const char *_String
);
420 _In_z_
const char *_String
,
421 _In_opt_ _locale_t _Locale
);
429 _In_z_
const char *_String
,
430 _Out_opt_ _Deref_post_z_
char **_EndPtr
,
439 _In_z_
const char *_String
,
440 _Out_opt_ _Deref_post_z_
char **_EndPtr
,
442 _In_opt_ _locale_t _Locale
);
450 _In_z_
const char *_String
,
451 _Out_opt_ _Deref_post_z_
char **_EndPtr
,
460 _In_z_
const char *_String
,
461 _Out_opt_ _Deref_post_z_
char **_EndPtr
,
463 _In_opt_ _locale_t _Locale
);
465 #endif /* _INTEGRAL_MAX_BITS >= 64 */
471 _In_
long _Numerator
,
472 _In_
long _Denominator
);
479 _Pre_notnull_ _Post_z_
char *_Dest
,
486 _In_reads_bytes_opt_(_MaxCount
) _Pre_opt_z_
const char *_Ch
,
487 _In_
size_t _MaxCount
);
494 _In_reads_bytes_opt_(_MaxCount
) _Pre_opt_z_
const char *_Ch
,
495 _In_
size_t _MaxCount
,
496 _In_opt_ _locale_t _Locale
);
503 _In_z_
const char *_Str
);
510 _In_z_
const char *_Str
,
511 _In_opt_ _locale_t _Locale
);
519 _In_z_
const char *_Str
,
520 _In_
size_t _MaxCount
);
527 _In_z_
const char *_Str
,
528 _In_
size_t _MaxCount
,
529 _In_opt_ _locale_t _Locale
);
534 _Pre_notnull_ _Post_z_
wchar_t *_DstCh
,
535 _In_reads_bytes_opt_(_SrcSizeInBytes
) _Pre_opt_z_
const char *_SrcCh
,
536 _In_
size_t _SrcSizeInBytes
);
542 _Pre_notnull_ _Post_z_
wchar_t *_DstCh
,
543 _In_reads_bytes_opt_(_SrcSizeInBytes
) _Pre_opt_z_
const char *_SrcCh
,
544 _In_
size_t _SrcSizeInBytes
,
545 _In_opt_ _locale_t _Locale
);
550 _Out_writes_opt_z_(_MaxCount
) wchar_t *_Dest
,
551 _In_z_
const char *_Source
,
552 _In_
size_t _MaxCount
);
558 _Out_writes_opt_z_(_MaxCount
) wchar_t *_Dest
,
559 _In_z_
const char *_Source
,
560 _In_
size_t _MaxCount
,
561 _In_opt_ _locale_t _Locale
);
578 _In_
unsigned int _Seed
);
584 _In_z_
const char *_Str
,
585 _Out_opt_ _Deref_post_z_
char **_EndPtr
);
593 #if !defined __NO_ISOCEXT /* in libmingwex.a */
594 float __cdecl
strtof (const char * __restrict__
, char ** __restrict__
);
595 long double __cdecl
strtold(const char * __restrict__
, char ** __restrict__
);
596 #endif /* __NO_ISOCEXT */
603 _In_z_
const char *_Str
,
604 _Out_opt_ _Deref_post_z_
char **_EndPtr
,
605 _In_opt_ _locale_t _Locale
);
611 _In_z_
const char *_Str
,
612 _Out_opt_ _Deref_post_z_
char **_EndPtr
,
620 _In_z_
const char *_Str
,
621 _Out_opt_ _Deref_post_z_
char **_EndPtr
,
623 _In_opt_ _locale_t _Locale
);
629 _In_z_
const char *_Str
,
630 _Out_opt_ _Deref_post_z_
char **_EndPtr
,
638 _In_z_
const char *_Str
,
639 _Out_opt_ _Deref_post_z_
char **_EndPtr
,
641 _In_opt_ _locale_t _Locale
);
643 #ifndef _CRT_SYSTEM_DEFINED
644 #define _CRT_SYSTEM_DEFINED
648 _In_opt_z_
const char *_Command
);
655 _In_
unsigned long _Value
,
656 _Pre_notnull_ _Post_z_
char *_Dest
,
662 _Out_writes_opt_z_(MB_LEN_MAX
) char *_MbCh
,
669 _Pre_maybenull_ _Post_z_
char *_MbCh
,
671 _In_opt_ _locale_t _Locale
);
676 _Out_writes_opt_z_(_MaxCount
) char *_Dest
,
677 _In_z_
const wchar_t *_Source
,
678 _In_
size_t _MaxCount
);
684 _Out_writes_opt_z_(_MaxCount
) char *_Dest
,
685 _In_z_
const wchar_t *_Source
,
686 _In_
size_t _MaxCount
,
687 _In_opt_ _locale_t _Locale
);
689 #ifndef _CRT_ALLOCATION_DEFINED
690 #define _CRT_ALLOCATION_DEFINED
694 _Post_writable_byte_size_(_NumOfElements
* _SizeOfElements
)
698 _In_
size_t _NumOfElements
,
699 _In_
size_t _SizeOfElements
);
704 _Pre_maybenull_ _Post_invalid_
void *_Memory
);
708 _Post_writable_byte_size_(_Size
)
714 _Success_(return != 0)
717 _Post_writable_byte_size_(_NewSize
)
721 _Pre_maybenull_ _Post_invalid_
void *_Memory
,
722 _In_
size_t _NewSize
);
724 _Success_(return != 0)
727 _Post_writable_byte_size_(_Count
* _Size
)
732 _Pre_maybenull_ _Post_invalid_
void *_Memory
,
736 /* Make sure that X86intrin.h doesn't produce here collisions. */
737 #if (!defined (_XMMINTRIN_H_INCLUDED) && !defined (_MM_MALLOC_H_INCLUDED)) || defined(_aligned_malloc)
738 #pragma push_macro("_aligned_free")
739 #pragma push_macro("_aligned_malloc")
741 #undef _aligned_malloc
747 _Pre_maybenull_ _Post_invalid_
void *_Memory
);
751 _Post_writable_byte_size_(_Size
)
757 _In_
size_t _Alignment
);
759 #pragma pop_macro("_aligned_free")
760 #pragma pop_macro("_aligned_malloc")
765 _Post_writable_byte_size_(_Size
)
769 _aligned_offset_malloc(
771 _In_
size_t _Alignment
,
772 _In_
size_t _Offset
);
774 _Success_(return != 0)
777 _Post_writable_byte_size_(_Size
)
782 _Pre_maybenull_ _Post_invalid_
void *_Memory
,
784 _In_
size_t _Alignment
);
786 _Success_(return != 0)
789 _Post_writable_byte_size_(_Count
* _Size
)
794 _Pre_maybenull_ _Post_invalid_
void *_Memory
,
797 _In_
size_t _Alignment
);
799 _Success_(return != 0)
802 _Post_writable_byte_size_(_Size
)
806 _aligned_offset_realloc(
807 _Pre_maybenull_ _Post_invalid_
void *_Memory
,
809 _In_
size_t _Alignment
,
810 _In_
size_t _Offset
);
814 _Post_writable_byte_size_(_Count
* _Size
)
818 _aligned_offset_recalloc(
819 _Pre_maybenull_ _Post_invalid_
void *_Memory
,
822 _In_
size_t _Alignment
,
823 _In_
size_t _Offset
);
825 #endif /* _CRT_ALLOCATION_DEFINED */
827 #ifndef _WSTDLIB_DEFINED
828 #define _WSTDLIB_DEFINED
835 _Pre_notnull_ _Post_z_
wchar_t *_Dest
,
843 _Pre_notnull_ _Post_z_
wchar_t *_Dest
,
850 _In_
unsigned long _Value
,
851 _Pre_notnull_ _Post_z_
wchar_t *_Dest
,
858 _In_z_
const wchar_t *_Str
,
859 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
);
867 #if !defined __NO_ISOCEXT /* in libmingwex.a */
868 float __cdecl
wcstof( const wchar_t * __restrict__
, wchar_t ** __restrict__
);
869 long double __cdecl
wcstold(const wchar_t * __restrict__
, wchar_t ** __restrict__
);
870 #endif /* __NO_ISOCEXT */
877 _In_z_
const wchar_t *_Str
,
878 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
,
879 _In_opt_ _locale_t _Locale
);
885 _In_z_
const wchar_t *_Str
,
886 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
,
894 _In_z_
const wchar_t *_Str
,
895 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
,
897 _In_opt_ _locale_t _Locale
);
903 _In_z_
const wchar_t *_Str
,
904 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
,
912 _In_z_
const wchar_t *_Str
,
913 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
,
915 _In_opt_ _locale_t _Locale
);
922 _In_z_
const wchar_t *_VarName
);
924 #ifndef _CRT_WSYSTEM_DEFINED
925 #define _CRT_WSYSTEM_DEFINED
930 _In_opt_z_
const wchar_t *_Command
);
938 _In_z_
const wchar_t *_Str
);
945 _In_z_
const wchar_t *_Str
,
946 _In_opt_ _locale_t _Locale
);
953 _In_z_
const wchar_t *_Str
);
960 _In_z_
const wchar_t *_Str
,
961 _In_opt_ _locale_t _Locale
);
968 _In_z_
const wchar_t *_Str
);
975 _In_z_
const wchar_t *_Str
,
976 _In_opt_ _locale_t _Locale
);
978 #if _INTEGRAL_MAX_BITS >= 64
986 _Pre_notnull_ _Post_z_
wchar_t *_DstBuf
,
994 _In_
unsigned __int64 _Val
,
995 _Pre_notnull_ _Post_z_
wchar_t *_DstBuf
,
1004 _In_z_
const wchar_t *_Str
);
1012 _In_z_
const wchar_t *_Str
,
1013 _In_opt_ _locale_t _Locale
);
1021 _In_z_
const wchar_t *_Str
,
1022 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
,
1031 _In_z_
const wchar_t *_Str
,
1032 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
,
1034 _In_opt_ _locale_t _Locale
);
1042 _In_z_
const wchar_t *_Str
,
1043 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
,
1052 _In_z_
const wchar_t *_Str
,
1053 _Out_opt_ _Deref_post_z_
wchar_t **_EndPtr
,
1055 _In_opt_ _locale_t _Locale
);
1057 #endif /* _INTEGRAL_MAX_BITS >= 64 */
1059 #endif /* _WSTDLIB_DEFINED */
1062 #define _CVTBUFSIZE (309+40)
1069 _Out_writes_opt_z_(_SizeInBytes
) char *_FullPath
,
1070 _In_z_
const char *_Path
,
1071 _In_
size_t _SizeInBytes
);
1079 _In_
int _NumOfDigits
,
1081 _Out_
int *_PtSign
);
1091 _Out_
int *_PtSign
);
1098 _In_
int _NumOfDigits
,
1099 _Pre_notnull_ _Post_z_
char *_DstBuf
);
1106 _Out_ _CRT_DOUBLE
*_Result
,
1114 _Out_ _LDOUBLE
*_Result
,
1122 _Out_ _CRT_FLOAT
*_Result
,
1130 _Out_ _CRT_DOUBLE
*_Result
,
1132 _In_opt_ _locale_t _Locale
);
1139 _Out_ _LDOUBLE
*_Result
,
1141 _In_opt_ _locale_t _Locale
);
1148 _Out_ _CRT_FLOAT
*_Result
,
1150 _In_opt_ _locale_t _Locale
);
1156 _In_
unsigned long _Val
,
1163 _In_
unsigned long _Val
,
1170 _Pre_notnull_ _Post_z_
char *_Path
,
1171 _In_opt_z_
const char *_Drive
,
1172 _In_opt_z_
const char *_Dir
,
1173 _In_opt_z_
const char *_Filename
,
1174 _In_opt_z_
const char *_Ext
);
1179 _In_opt_ _onexit_t _Func
);
1181 #ifndef _CRT_PERROR_DEFINED
1182 #define _CRT_PERROR_DEFINED
1186 _In_opt_z_
const char *_ErrMsg
);
1194 _In_z_
const char *_EnvString
);
1196 #if !defined(__GNUC__) && !defined(__clang__)
1201 _In_
unsigned int _Val
,
1204 #if _INTEGRAL_MAX_BITS >= 64
1209 _In_
unsigned __int64 _Val
,
1216 _In_
unsigned int _Val
,
1219 #if _INTEGRAL_MAX_BITS >= 64
1224 _In_
unsigned __int64 _Val
,
1228 #endif /* !defined(__GNUC__) && !defined(__clang__) */
1234 _In_z_
const char *_Filename
,
1235 _In_z_
const char *_EnvVar
,
1236 _Pre_notnull_ _Post_z_
char *_ResultPath
);
1242 _In_z_
const char *_FullPath
,
1243 _Pre_maybenull_ _Post_z_
char *_Drive
,
1244 _Pre_maybenull_ _Post_z_
char *_Dir
,
1245 _Pre_maybenull_ _Post_z_
char *_Filename
,
1246 _Pre_maybenull_ _Post_z_
char *_Ext
);
1252 _Inout_updates_(_SizeInBytes
) _Post_readable_size_(_SizeInBytes
) char *_Buf1
,
1253 _Inout_updates_(_SizeInBytes
) _Post_readable_size_(_SizeInBytes
) char *_Buf2
,
1256 #ifndef _WSTDLIBP_DEFINED
1257 #define _WSTDLIBP_DEFINED
1264 _Out_writes_opt_z_(_SizeInWords
) wchar_t *_FullPath
,
1265 _In_z_
const wchar_t *_Path
,
1266 _In_
size_t _SizeInWords
);
1272 _Pre_notnull_ _Post_z_
wchar_t *_ResultPath
,
1273 _In_opt_z_
const wchar_t *_Drive
,
1274 _In_opt_z_
const wchar_t *_Dir
,
1275 _In_opt_z_
const wchar_t *_Filename
,
1276 _In_opt_z_
const wchar_t *_Ext
);
1278 #ifndef _CRT_WPERROR_DEFINED
1279 #define _CRT_WPERROR_DEFINED
1284 _In_opt_z_
const wchar_t *_ErrMsg
);
1292 _In_z_
const wchar_t *_EnvString
);
1298 _In_z_
const wchar_t *_Filename
,
1299 _In_z_
const wchar_t *_EnvVar
,
1300 _Pre_notnull_ _Post_z_
wchar_t *_ResultPath
);
1306 _In_z_
const wchar_t *_FullPath
,
1307 _Pre_maybenull_ _Post_z_
wchar_t *_Drive
,
1308 _Pre_maybenull_ _Post_z_
wchar_t *_Dir
,
1309 _Pre_maybenull_ _Post_z_
wchar_t *_Filename
,
1310 _Pre_maybenull_ _Post_z_
wchar_t *_Ext
);
1312 #endif /* _WSTDLIBP_DEFINED */
1315 __MINGW_ATTRIB_DEPRECATED
1319 _In_
unsigned _Frequency
,
1320 _In_
unsigned _Duration
);
1322 /* Not to be confused with _set_error_mode (int). */
1324 __MINGW_ATTRIB_DEPRECATED
1331 __MINGW_ATTRIB_DEPRECATED
1335 _In_
unsigned long _Duration
);
1337 #endif /* _POSIX_ */
1345 #define max(a,b) (((a) > (b)) ? (a) : (b))
1348 #define min(a,b) (((a) < (b)) ? (a) : (b))
1350 #endif /* NOMINMAX */
1351 #endif /* __cplusplus */
1354 #define sys_errlist _sys_errlist
1355 #define sys_nerr _sys_nerr
1356 #define environ _environ
1364 _In_
int _NumOfDigits
,
1366 _Out_
int *_PtSign
);
1376 _Out_
int *_PtSign
);
1383 _In_
int _NumOfDigits
,
1384 _Pre_notnull_ _Post_z_
char *_DstBuf
);
1391 _Pre_notnull_ _Post_z_
char *_DstBuf
,
1399 _Pre_notnull_ _Post_z_
char *_DstBuf
,
1407 _In_z_
const char *_EnvString
);
1413 _Inout_updates_z_(_SizeInBytes
) char *_Buf1
,
1414 _Inout_updates_z_(_SizeInBytes
) char *_Buf2
,
1415 _In_
int _SizeInBytes
);
1421 _In_
unsigned long _Val
,
1422 _Pre_notnull_ _Post_z_
char *_Dstbuf
,
1428 _In_opt_ onexit_t _Func
);
1430 #endif /* _POSIX_ */
1431 #endif /* NO_OLDNAMES */
1433 #if !defined __NO_ISOCEXT /* externs in static libmingwex.a */
1435 __MINGW_EXTENSION
typedef struct { long long quot
, rem
; } lldiv_t
;
1437 _Check_return_ __MINGW_EXTENSION lldiv_t __cdecl
lldiv(_In_
long long, _In_
long long);
1440 __MINGW_EXTENSION __CRT_INLINE
long long __cdecl
llabs(_In_
long long _j
) { return (_j
>= 0 ? _j
: -_j
); }
1443 __MINGW_EXTENSION
long long __cdecl
strtoll(const char* __restrict__
, char** __restrict
, int);
1444 __MINGW_EXTENSION
unsigned long long __cdecl
strtoull(const char* __restrict__
, char** __restrict__
, int);
1446 /* these are stubs for MS _i64 versions */
1447 __MINGW_EXTENSION
long long __cdecl
atoll (const char *);
1449 #ifndef __STRICT_ANSI__
1450 __MINGW_EXTENSION
long long __cdecl
wtoll (const wchar_t *);
1451 __MINGW_EXTENSION
char *__cdecl
lltoa (long long, char *, int);
1452 __MINGW_EXTENSION
char *__cdecl
ulltoa (unsigned long long , char *, int);
1453 __MINGW_EXTENSION
wchar_t *__cdecl
lltow (long long, wchar_t *, int);
1454 __MINGW_EXTENSION
wchar_t *__cdecl
ulltow (unsigned long long, wchar_t *, int);
1456 /* __CRT_INLINE using non-ansi functions */
1457 __MINGW_EXTENSION __CRT_INLINE
long long __cdecl
atoll (const char * _c
) { return _atoi64 (_c
); }
1458 __MINGW_EXTENSION __CRT_INLINE
char *__cdecl
lltoa (long long _n
, char * _c
, int _i
) { return _i64toa (_n
, _c
, _i
); }
1459 __MINGW_EXTENSION __CRT_INLINE
char *__cdecl
ulltoa (unsigned long long _n
, char * _c
, int _i
) { return _ui64toa (_n
, _c
, _i
); }
1460 __MINGW_EXTENSION __CRT_INLINE
long long __cdecl
wtoll (const wchar_t * _w
) { return _wtoi64 (_w
); }
1461 __MINGW_EXTENSION __CRT_INLINE
wchar_t *__cdecl
lltow (long long _n
, wchar_t * _w
, int _i
) { return _i64tow (_n
, _w
, _i
); }
1462 __MINGW_EXTENSION __CRT_INLINE
wchar_t *__cdecl
ulltow (unsigned long long _n
, wchar_t * _w
, int _i
) { return _ui64tow (_n
, _w
, _i
); }
1463 #endif /* (__STRICT_ANSI__) */
1465 #endif /* !__NO_ISOCEXT */
1473 #include <sec_api/stdlib_s.h>