2 * Copyright 2010 Piotr Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #define ALIGNED_SIZE(size, alignment) (((size)+((alignment)-1))/(alignment)*(alignment))
25 typedef unsigned char MSVCP_bool
;
26 typedef SIZE_T MSVCP_size_t
;
29 typedef __int64
DECLSPEC_ALIGN(8) streamoff
;
30 typedef __int64
DECLSPEC_ALIGN(8) streamsize
;
31 #define STREAMOFF_BITS 64
32 #define STREAMSIZE_BITS 64
34 typedef SSIZE_T streamoff
;
35 typedef SSIZE_T streamsize
;
36 #define STREAMOFF_BITS 32
37 #define STREAMSIZE_BITS 32
40 void __cdecl
_invalid_parameter_noinfo(void);
41 void __cdecl
_invalid_parameter(const wchar_t*, const wchar_t*,
42 const wchar_t*, unsigned int, uintptr_t);
43 BOOL __cdecl
__uncaught_exception(void);
44 int __cdecl
_callnewh(size_t);
46 extern void* (__cdecl
*MSVCRT_operator_new
)(MSVCP_size_t
);
47 extern void (__cdecl
*MSVCRT_operator_delete
)(void*);
48 extern void* (__cdecl
*MSVCRT_set_new_handler
)(void*);
51 extern int* (__cdecl
*UCRTBASE___processing_throw
)(void);
55 /* keep in sync with msvcrt/lock.c */
56 typedef struct cs_queue
58 struct cs_queue
*next
;
65 ULONG_PTR unk_thread_id
;
72 extern critical_section
* (__thiscall
*critical_section_ctor
)(critical_section
*);
73 extern void (__thiscall
*critical_section_dtor
)(critical_section
*);
74 extern void (__thiscall
*critical_section_lock
)(critical_section
*);
75 extern void (__thiscall
*critical_section_unlock
)(critical_section
*);
76 extern MSVCP_bool (__thiscall
*critical_section_trylock
)(critical_section
*);
80 extern MSVCP_bool (__cdecl
*Context_IsCurrentTaskCollectionCanceling
)(void);
83 /* basic_string<char, char_traits<char>, allocator<char>> */
91 #define BUF_SIZE_CHAR 16
92 char buf
[BUF_SIZE_CHAR
];
103 basic_string_char
* __thiscall
MSVCP_basic_string_char_ctor(basic_string_char
*);
104 basic_string_char
* __thiscall
MSVCP_basic_string_char_ctor_cstr(basic_string_char
*, const char*);
105 basic_string_char
* __thiscall
MSVCP_basic_string_char_ctor_cstr_len(basic_string_char
*, const char*, MSVCP_size_t
);
106 basic_string_char
* __thiscall
MSVCP_basic_string_char_copy_ctor(basic_string_char
*, const basic_string_char
*);
107 void* __thiscall
MSVCP_basic_string_char_dtor(basic_string_char
*);
108 const char* __thiscall
MSVCP_basic_string_char_c_str(const basic_string_char
*);
109 void __thiscall
MSVCP_basic_string_char_clear(basic_string_char
*);
110 basic_string_char
* __thiscall
MSVCP_basic_string_char_append_ch(basic_string_char
*, char);
111 MSVCP_size_t __thiscall
MSVCP_basic_string_char_length(const basic_string_char
*);
112 basic_string_char
* __thiscall
MSVCP_basic_string_char_assign(basic_string_char
*, const basic_string_char
*);
121 #define BUF_SIZE_WCHAR 8
122 wchar_t buf
[BUF_SIZE_WCHAR
];
128 #if _MSVCP_VER == 100
131 } basic_string_wchar
;
133 basic_string_wchar
* __thiscall
MSVCP_basic_string_wchar_ctor(basic_string_wchar
*);
134 basic_string_wchar
* __thiscall
MSVCP_basic_string_wchar_ctor_cstr(basic_string_wchar
*, const wchar_t*);
135 basic_string_wchar
* __thiscall
MSVCP_basic_string_wchar_ctor_cstr_len(basic_string_wchar
*, const wchar_t*, MSVCP_size_t
);
136 void* __thiscall
MSVCP_basic_string_wchar_dtor(basic_string_wchar
*);
137 const wchar_t* __thiscall
MSVCP_basic_string_wchar_c_str(const basic_string_wchar
*);
138 void __thiscall
MSVCP_basic_string_wchar_clear(basic_string_wchar
*);
139 basic_string_wchar
* __thiscall
MSVCP_basic_string_wchar_append_ch(basic_string_wchar
*, wchar_t);
140 MSVCP_size_t __thiscall
MSVCP_basic_string_wchar_length(const basic_string_wchar
*);
142 char* __thiscall
MSVCP_allocator_char_allocate(void*, MSVCP_size_t
);
143 void __thiscall
MSVCP_allocator_char_deallocate(void*, char*, MSVCP_size_t
);
144 MSVCP_size_t __thiscall
MSVCP_allocator_char_max_size(const void*);
145 wchar_t* __thiscall
MSVCP_allocator_wchar_allocate(void*, MSVCP_size_t
);
146 void __thiscall
MSVCP_allocator_wchar_deallocate(void*, wchar_t*, MSVCP_size_t
);
147 MSVCP_size_t __thiscall
MSVCP_allocator_wchar_max_size(const void*);
155 _Yarn_char
* __thiscall
_Yarn_char_ctor(_Yarn_char
*);
156 _Yarn_char
* __thiscall
_Yarn_char_ctor_cstr(_Yarn_char
*, const char*);
157 _Yarn_char
* __thiscall
_Yarn_char_copy_ctor(_Yarn_char
*, const _Yarn_char
*);
158 const char* __thiscall
_Yarn_char_c_str(const _Yarn_char
*);
159 void __thiscall
_Yarn_char_dtor(_Yarn_char
*);
160 _Yarn_char
* __thiscall
_Yarn_char_op_assign(_Yarn_char
*, const _Yarn_char
*);
168 _Yarn_wchar
* __thiscall
_Yarn_wchar_ctor(_Yarn_wchar
*);
169 const wchar_t* __thiscall
_Yarn_wchar__C_str(const _Yarn_wchar
*);
170 void __thiscall
_Yarn_wchar_dtor(_Yarn_wchar
*);
171 _Yarn_wchar
* __thiscall
_Yarn_wchar_op_assign_cstr(_Yarn_wchar
*, const wchar_t*);
173 /* class locale::facet */
175 const vtable_ptr
*vtable
;
184 } codecvt_base_result
;
193 #if _MSVCP_VER >= 110
198 #if _MSVCP_VER >= 140
201 unsigned short byte
, state
;
203 #define MBSTATET_TO_INT(state) ((state)->wchar)
205 typedef int _Mbstatet
;
206 #define MBSTATET_TO_INT(state) (*(state))
209 /* class codecvt_base */
214 /* class codecvt<char> */
219 MSVCP_bool __thiscall
codecvt_base_always_noconv(const codecvt_base
*);
220 int __thiscall
codecvt_char_unshift(const codecvt_char
*, _Mbstatet
*, char*, char*, char**);
221 int __thiscall
codecvt_char_out(const codecvt_char
*, _Mbstatet
*, const char*,
222 const char*, const char**, char*, char*, char**);
223 int __thiscall
codecvt_char_in(const codecvt_char
*, _Mbstatet
*, const char*,
224 const char*, const char**, char*, char*, char**);
225 int __thiscall
codecvt_base_max_length(const codecvt_base
*);
232 #if _MSVCP_VER >= 110
239 /* class codecvt<wchar> */
245 int __thiscall
codecvt_wchar_unshift(const codecvt_wchar
*, _Mbstatet
*, char*, char*, char**);
246 int __thiscall
codecvt_wchar_out(const codecvt_wchar
*, _Mbstatet
*, const wchar_t*,
247 const wchar_t*, const wchar_t**, char*, char*, char**);
248 int __thiscall
codecvt_wchar_in(const codecvt_wchar
*, _Mbstatet
*, const char*,
249 const char*, const char**, wchar_t*, wchar_t*, wchar_t**);
251 /* class ctype_base */
256 /* class ctype<char> */
262 MSVCP_bool __thiscall
ctype_char_is_ch(const ctype_char
*, short, char);
263 char __thiscall
ctype_char_narrow_ch(const ctype_char
*, char, char);
264 char __thiscall
ctype_char_widen_ch(const ctype_char
*, char);
266 /* class ctype<wchar> */
273 MSVCP_bool __thiscall
ctype_wchar_is_ch(const ctype_wchar
*, short, wchar_t);
274 char __thiscall
ctype_wchar_narrow_ch(const ctype_wchar
*, wchar_t, char);
275 wchar_t __thiscall
ctype_wchar_widen_ch(const ctype_wchar
*, char);
280 #if _MSVCP_VER >= 140
283 struct _locale__Locimp
*ptr
;
286 locale
* __thiscall
locale_ctor(locale
*);
287 locale
* __thiscall
locale_copy_ctor(locale
*, const locale
*);
288 locale
* __thiscall
locale_operator_assign(locale
*, const locale
*);
289 void __thiscall
locale_dtor(locale
*);
290 void free_locale(void);
291 codecvt_char
* codecvt_char_use_facet(const locale
*);
292 codecvt_wchar
* codecvt_wchar_use_facet(const locale
*);
293 codecvt_wchar
* codecvt_short_use_facet(const locale
*);
294 ctype_char
* ctype_char_use_facet(const locale
*);
295 ctype_wchar
* ctype_wchar_use_facet(const locale
*);
296 ctype_wchar
* ctype_short_use_facet(const locale
*);
307 #define _LOCK_LOCALE 0
308 #define _LOCK_MALLOC 1
309 #define _LOCK_STREAM 2
310 #define _LOCK_DEBUG 3
313 void init_lockit(void);
314 void free_lockit(void);
315 _Lockit
* __thiscall
_Lockit_ctor_locktype(_Lockit
*, int);
316 void __thiscall
_Lockit_dtor(_Lockit
*);
323 mutex
* __thiscall
mutex_ctor(mutex
*);
324 void __thiscall
mutex_dtor(mutex
*);
325 void __thiscall
mutex_lock(mutex
*);
326 void __thiscall
mutex_unlock(mutex
*);
329 FMTFLAG_skipws
= 0x0001,
330 FMTFLAG_unitbuf
= 0x0002,
331 FMTFLAG_uppercase
= 0x0004,
332 FMTFLAG_showbase
= 0x0008,
333 FMTFLAG_showpoint
= 0x0010,
334 FMTFLAG_showpos
= 0x0020,
335 FMTFLAG_left
= 0x0040,
336 FMTFLAG_right
= 0x0080,
337 FMTFLAG_internal
= 0x0100,
338 FMTFLAG_dec
= 0x0200,
339 FMTFLAG_oct
= 0x0400,
340 FMTFLAG_hex
= 0x0800,
341 FMTFLAG_scientific
= 0x1000,
342 FMTFLAG_fixed
= 0x2000,
343 FMTFLAG_hexfloat
= 0x3000,
344 FMTFLAG_boolalpha
= 0x4000,
345 FMTFLAG_stdio
= 0x8000,
346 FMTFLAG_adjustfield
= FMTFLAG_left
|FMTFLAG_right
|FMTFLAG_internal
,
347 FMTFLAG_basefield
= FMTFLAG_dec
|FMTFLAG_oct
|FMTFLAG_hex
,
348 FMTFLAG_floatfield
= FMTFLAG_scientific
|FMTFLAG_fixed
,
349 FMTFLAG_mask
= 0xffff
357 OPENMODE_trunc
= 0x10,
358 OPENMODE__Nocreate
= 0x40,
359 OPENMODE__Noreplace
= 0x80,
360 OPENMODE_binary
= 0x20,
372 IOSTATE_goodbit
= 0x00,
373 IOSTATE_eofbit
= 0x01,
374 IOSTATE_failbit
= 0x02,
375 IOSTATE_badbit
= 0x04,
376 IOSTATE__Hardfail
= 0x10,
380 typedef struct _iosarray
{
381 struct _iosarray
*next
;
394 typedef void (CDECL
*IOS_BASE_event_callback
)(IOS_BASE_event
, struct _ios_base
*, int);
395 typedef struct _fnarray
{
396 struct _fnarray
*next
;
398 IOS_BASE_event_callback event_handler
;
402 typedef struct _ios_base
{
403 const vtable_ptr
*vtable
;
404 #if _MSVCP_VER >= 100
405 MSVCP_size_t
DECLSPEC_ALIGN(8) stdstr
;
406 #elif _MSVCP_VER >= 71
414 IOS_BASE_iosarray
*arr
;
415 IOS_BASE_fnarray
*calls
;
426 /* class basic_streambuf<char> */
428 const vtable_ptr
*vtable
;
429 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
449 } basic_streambuf_char
;
452 basic_streambuf_char
*strbuf
;
455 } istreambuf_iterator_char
;
459 void *iter_container
;
462 basic_streambuf_char
*strbuf
;
463 } ostreambuf_iterator_char
;
465 int __thiscall
basic_streambuf_char_sgetc(basic_streambuf_char
*);
466 int __thiscall
basic_streambuf_char_sbumpc(basic_streambuf_char
*);
467 int __thiscall
basic_streambuf_char_sputc(basic_streambuf_char
*, char);
469 /* class basic_streambuf<wchar> */
471 const vtable_ptr
*vtable
;
472 #if _MSVCP_VER >= 70 && _MSVCP_VER <= 100
492 } basic_streambuf_wchar
;
495 basic_streambuf_wchar
*strbuf
;
498 } istreambuf_iterator_wchar
;
502 void *iter_container
;
505 basic_streambuf_wchar
*strbuf
;
506 } ostreambuf_iterator_wchar
;
508 unsigned short __thiscall
basic_streambuf_wchar_sgetc(basic_streambuf_wchar
*);
509 unsigned short __thiscall
basic_streambuf_wchar_sbumpc(basic_streambuf_wchar
*);
510 unsigned short __thiscall
basic_streambuf_wchar_sputc(basic_streambuf_wchar
*, wchar_t);
513 #define IOS_LOCALE(ios) (&(ios)->loc)
515 #define IOS_LOCALE(ios) ((ios)->loc)
518 /* class num_get<char> */
521 #if _MSVCP_VER <= 100
526 num_get
* num_get_char_use_facet(const locale
*);
527 istreambuf_iterator_char
* __thiscall
num_get_char_get_long(const num_get
*, istreambuf_iterator_char
*,
528 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, LONG
*);
529 istreambuf_iterator_char
* __thiscall
num_get_char_get_ushort(const num_get
*, istreambuf_iterator_char
*,
530 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, unsigned short*);
531 istreambuf_iterator_char
* __thiscall
num_get_char_get_uint(const num_get
*, istreambuf_iterator_char
*,
532 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, unsigned int*);
533 istreambuf_iterator_char
* __thiscall
num_get_char_get_ulong(const num_get
*, istreambuf_iterator_char
*,
534 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, ULONG
*);
535 istreambuf_iterator_char
* __thiscall
num_get_char_get_float(const num_get
*, istreambuf_iterator_char
*,
536 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, float*);
537 istreambuf_iterator_char
*__thiscall
num_get_char_get_double(const num_get
*, istreambuf_iterator_char
*,
538 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, double*);
539 istreambuf_iterator_char
*__thiscall
num_get_char_get_ldouble(const num_get
*, istreambuf_iterator_char
*,
540 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, double*);
541 istreambuf_iterator_char
*__thiscall
num_get_char_get_void(const num_get
*, istreambuf_iterator_char
*,
542 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, void**);
543 istreambuf_iterator_char
*__thiscall
num_get_char_get_int64(const num_get
*, istreambuf_iterator_char
*,
544 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, LONGLONG
*);
545 istreambuf_iterator_char
*__thiscall
num_get_char_get_uint64(const num_get
*, istreambuf_iterator_char
*,
546 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, ULONGLONG
*);
547 istreambuf_iterator_char
*__thiscall
num_get_char_get_bool(const num_get
*, istreambuf_iterator_char
*,
548 istreambuf_iterator_char
, istreambuf_iterator_char
, ios_base
*, int*, MSVCP_bool
*);
550 num_get
* num_get_wchar_use_facet(const locale
*);
551 num_get
* num_get_short_use_facet(const locale
*);
552 istreambuf_iterator_wchar
* __thiscall
num_get_wchar_get_long(const num_get
*, istreambuf_iterator_wchar
*,
553 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, LONG
*);
554 istreambuf_iterator_wchar
* __thiscall
num_get_wchar_get_ushort(const num_get
*, istreambuf_iterator_wchar
*,
555 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, unsigned short*);
556 istreambuf_iterator_wchar
* __thiscall
num_get_wchar_get_uint(const num_get
*, istreambuf_iterator_wchar
*,
557 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, unsigned int*);
558 istreambuf_iterator_wchar
* __thiscall
num_get_wchar_get_ulong(const num_get
*, istreambuf_iterator_wchar
*,
559 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, ULONG
*);
560 istreambuf_iterator_wchar
* __thiscall
num_get_wchar_get_float(const num_get
*, istreambuf_iterator_wchar
*,
561 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, float*);
562 istreambuf_iterator_wchar
*__thiscall
num_get_wchar_get_double(const num_get
*, istreambuf_iterator_wchar
*,
563 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, double*);
564 istreambuf_iterator_wchar
*__thiscall
num_get_wchar_get_ldouble(const num_get
*, istreambuf_iterator_wchar
*,
565 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, double*);
566 istreambuf_iterator_wchar
*__thiscall
num_get_wchar_get_void(const num_get
*, istreambuf_iterator_wchar
*,
567 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, void**);
568 istreambuf_iterator_wchar
*__thiscall
num_get_wchar_get_int64(const num_get
*, istreambuf_iterator_wchar
*,
569 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, LONGLONG
*);
570 istreambuf_iterator_wchar
*__thiscall
num_get_wchar_get_uint64(const num_get
*, istreambuf_iterator_wchar
*,
571 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, ULONGLONG
*);
572 istreambuf_iterator_wchar
*__thiscall
num_get_wchar_get_bool(const num_get
*, istreambuf_iterator_wchar
*,
573 istreambuf_iterator_wchar
, istreambuf_iterator_wchar
, ios_base
*, int*, MSVCP_bool
*);
575 /* class num_put<char> */
576 /* class num_put<wchar> */
584 num_put
* num_put_char_use_facet(const locale
*);
585 ostreambuf_iterator_char
* __thiscall
num_put_char_put_long(const num_put
*, ostreambuf_iterator_char
*,
586 ostreambuf_iterator_char
, ios_base
*, char, LONG
);
587 ostreambuf_iterator_char
* __thiscall
num_put_char_put_ulong(const num_put
*, ostreambuf_iterator_char
*,
588 ostreambuf_iterator_char
, ios_base
*, char, ULONG
);
589 ostreambuf_iterator_char
* __thiscall
num_put_char_put_double(const num_put
*, ostreambuf_iterator_char
*,
590 ostreambuf_iterator_char
, ios_base
*, char, double);
591 ostreambuf_iterator_char
* __thiscall
num_put_char_put_ldouble(const num_put
*, ostreambuf_iterator_char
*,
592 ostreambuf_iterator_char
, ios_base
*, char, double);
593 ostreambuf_iterator_char
* __thiscall
num_put_char_put_ptr(const num_put
*, ostreambuf_iterator_char
*,
594 ostreambuf_iterator_char
, ios_base
*, char, const void*);
595 ostreambuf_iterator_char
* __thiscall
num_put_char_put_int64(const num_put
*, ostreambuf_iterator_char
*,
596 ostreambuf_iterator_char
, ios_base
*, char, __int64
);
597 ostreambuf_iterator_char
* __thiscall
num_put_char_put_uint64(const num_put
*, ostreambuf_iterator_char
*,
598 ostreambuf_iterator_char
, ios_base
*, char, unsigned __int64
);
599 ostreambuf_iterator_char
* __thiscall
num_put_char_put_bool(const num_put
*, ostreambuf_iterator_char
*,
600 ostreambuf_iterator_char
, ios_base
*, char, MSVCP_bool
);
602 num_put
* num_put_wchar_use_facet(const locale
*);
603 num_put
* num_put_short_use_facet(const locale
*);
604 ostreambuf_iterator_wchar
* __thiscall
num_put_wchar_put_long(const num_put
*, ostreambuf_iterator_wchar
*,
605 ostreambuf_iterator_wchar
, ios_base
*, wchar_t, LONG
);
606 ostreambuf_iterator_wchar
* __thiscall
num_put_wchar_put_ulong(const num_put
*, ostreambuf_iterator_wchar
*,
607 ostreambuf_iterator_wchar
, ios_base
*, wchar_t, ULONG
);
608 ostreambuf_iterator_wchar
* __thiscall
num_put_wchar_put_double(const num_put
*, ostreambuf_iterator_wchar
*,
609 ostreambuf_iterator_wchar
, ios_base
*, wchar_t, double);
610 ostreambuf_iterator_wchar
* __thiscall
num_put_wchar_put_ldouble(const num_put
*, ostreambuf_iterator_wchar
*,
611 ostreambuf_iterator_wchar
, ios_base
*, wchar_t, double);
612 ostreambuf_iterator_wchar
* __thiscall
num_put_wchar_put_ptr(const num_put
*, ostreambuf_iterator_wchar
*,
613 ostreambuf_iterator_wchar
, ios_base
*, wchar_t, const void*);
614 ostreambuf_iterator_wchar
* __thiscall
num_put_wchar_put_int64(const num_put
*, ostreambuf_iterator_wchar
*,
615 ostreambuf_iterator_wchar
, ios_base
*, wchar_t, __int64
);
616 ostreambuf_iterator_wchar
* __thiscall
num_put_wchar_put_uint64(const num_put
*, ostreambuf_iterator_wchar
*,
617 ostreambuf_iterator_wchar
, ios_base
*, wchar_t, unsigned __int64
);
618 ostreambuf_iterator_wchar
* __thiscall
num_put_wchar_put_bool(const num_put
*, ostreambuf_iterator_wchar
*,
619 ostreambuf_iterator_wchar
, ios_base
*, wchar_t, MSVCP_bool
);
621 void init_exception(void*);
622 void init_locale(void*);
625 void init_misc(void*);
627 /* class complex<float> */
633 /* class complex<double> */
634 /* class complex<long double> */
641 static inline int memcpy_wrapper( void *dst
, size_t size
, const void *src
, size_t count
)
643 memcpy( dst
, src
, count
);
646 static inline int memmove_wrapper( void *dst
, size_t size
, const void *src
, size_t count
)
648 memmove( dst
, src
, count
);
651 static inline int mbstowcs_wrapper( size_t *ret
, wchar_t *wcs
, size_t size
, const char *mbs
, size_t count
)
653 mbstowcs( wcs
, mbs
, count
);
656 #define memcpy_s( dst, size, src, count ) memcpy_wrapper( dst, size, src, count )
657 #define memmove_s( dst, size, src, count ) memmove_wrapper( dst, size, src, count )
658 #define mbstowcs_s( ret, wcs, size, mbs, count ) mbstowcs_wrapper( ret, wcs, size, mbs, count )
659 #define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) ))
662 void free_misc(void);
664 #if _MSVCP_VER >= 140
665 #define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002)
666 int __cdecl
__stdio_common_vsprintf(unsigned __int64 options
, char *str
, size_t len
, const char *format
,
667 _locale_t locale
, __ms_va_list valist
);