Skip to content

Commit 439e67d

Browse files
committed
[CRT] vadefs.h: Fix name of __crt_va_*
This is to be compatible with native CRT headers.
1 parent 325d74c commit 439e67d

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

sdk/include/crt/stdarg.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ Boston, MA 02110-1301, USA. */
4141
#endif
4242

4343
#ifndef va_start
44-
#define va_start _crt_va_start
44+
#define va_start __crt_va_start
4545
#endif
4646
#ifndef va_arg
47-
#define va_arg _crt_va_arg
47+
#define va_arg __crt_va_arg
4848
#endif
4949
#ifndef va_end
50-
#define va_end _crt_va_end
50+
#define va_end __crt_va_end
5151
#endif
5252

5353
#endif

sdk/include/crt/vadefs.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,44 +40,44 @@ extern "C" {
4040
#define _INTSIZEOF(n) ((sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1))
4141

4242
#if defined(__GNUC__) || defined(__clang__)
43-
#define _crt_va_start(v,l) __builtin_va_start(v,l)
44-
#define _crt_va_arg(v,l) __builtin_va_arg(v,l)
45-
#define _crt_va_end(v) __builtin_va_end(v)
43+
#define __crt_va_start(v,l) __builtin_va_start(v,l)
44+
#define __crt_va_arg(v,l) __builtin_va_arg(v,l)
45+
#define __crt_va_end(v) __builtin_va_end(v)
4646
#define __va_copy(d,s) __builtin_va_copy(d,s)
4747
#elif defined(_MSC_VER)
4848

4949
#if defined(_M_IX86)
50-
#define _crt_va_start(v,l) ((void)((v) = (va_list)_ADDRESSOF(l) + _INTSIZEOF(l)))
51-
#define _crt_va_arg(v,l) (*(l *)(((v) += _INTSIZEOF(l)) - _INTSIZEOF(l)))
52-
#define _crt_va_end(v) ((void)((v) = (va_list)0))
50+
#define __crt_va_start(v,l) ((void)((v) = (va_list)_ADDRESSOF(l) + _INTSIZEOF(l)))
51+
#define __crt_va_arg(v,l) (*(l *)(((v) += _INTSIZEOF(l)) - _INTSIZEOF(l)))
52+
#define __crt_va_end(v) ((void)((v) = (va_list)0))
5353
#define __va_copy(d,s) ((void)((d) = (s)))
5454
#elif defined(_M_AMD64)
5555
#define _PTRSIZEOF(n) ((sizeof(n) + sizeof(void*) - 1) & ~(sizeof(void*) - 1))
5656
#define _ISSTRUCT(t) ((sizeof(t) > sizeof(void*)) || (sizeof(t) & (sizeof(t)-1)) != 0)
57-
#define _crt_va_start(v,l) ((void)((v) = (va_list)_ADDRESSOF(l) + _PTRSIZEOF(l)))
58-
#define _crt_va_arg(v,t) (_ISSTRUCT(t) ? \
57+
#define __crt_va_start(v,l) ((void)((v) = (va_list)_ADDRESSOF(l) + _PTRSIZEOF(l)))
58+
#define __crt_va_arg(v,t) (_ISSTRUCT(t) ? \
5959
(**(t**)(((v) += sizeof(void*)) - sizeof(void*))) : \
6060
(*(t*)(((v) += sizeof(void*)) - sizeof(void*))))
61-
#define _crt_va_end(v) ((void)((v) = (va_list)0))
61+
#define __crt_va_end(v) ((void)((v) = (va_list)0))
6262
#define __va_copy(d,s) ((void)((d) = (s)))
6363
#elif defined(_M_ARM)
6464
#ifdef __cplusplus
6565
extern void __cdecl __va_start(va_list*, ...);
66-
#define _crt_va_start(ap,v) __va_start(&ap, _ADDRESSOF(v), _SLOTSIZEOF(v), _ADDRESSOF(v))
66+
#define __crt_va_start(ap,v) __va_start(&ap, _ADDRESSOF(v), _SLOTSIZEOF(v), _ADDRESSOF(v))
6767
#else
68-
#define _crt_va_start(ap,v) (ap = (va_list)_ADDRESSOF(v) + _SLOTSIZEOF(v))
68+
#define __crt_va_start(ap,v) (ap = (va_list)_ADDRESSOF(v) + _SLOTSIZEOF(v))
6969
#endif
70-
#define _crt_va_arg(ap,t) (*(t*)((ap += _SLOTSIZEOF(t) + _APALIGN(t,ap)) - _SLOTSIZEOF(t)))
71-
#define _crt_va_end(ap) ( ap = (va_list)0 )
70+
#define __crt_va_arg(ap,t) (*(t*)((ap += _SLOTSIZEOF(t) + _APALIGN(t,ap)) - _SLOTSIZEOF(t)))
71+
#define __crt_va_end(ap) ( ap = (va_list)0 )
7272
#define __va_copy(d,s) ((void)((d) = (s)))
7373
#elif defined(_M_ARM64)
7474
extern void __cdecl __va_start(va_list*, ...);
75-
#define _crt_va_start(ap,v) ((void)(__va_start(&ap, _ADDRESSOF(v), _SLOTSIZEOF(v), __alignof(v), _ADDRESSOF(v))))
76-
#define _crt_va_arg(ap, t) \
75+
#define __crt_va_start(ap,v) ((void)(__va_start(&ap, _ADDRESSOF(v), _SLOTSIZEOF(v), __alignof(v), _ADDRESSOF(v))))
76+
#define __crt_va_arg(ap, t) \
7777
((sizeof(t) > (2 * sizeof(__int64))) \
7878
? **(t**)((ap += sizeof(__int64)) - sizeof(__int64)) \
7979
: *(t*)((ap += _SLOTSIZEOF(t) + _APALIGN(t,ap)) - _SLOTSIZEOF(t)))
80-
#define _crt_va_end(ap) ((void)(ap = (va_list)0))
80+
#define __crt_va_end(ap) ((void)(ap = (va_list)0))
8181
#define __va_copy(d,s) ((void)((d) = (s)))
8282
#else //if defined(_M_IA64) || defined(_M_CEE)
8383
#error Please implement me

0 commit comments

Comments
 (0)