STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
varargs.h
Go to the documentation of this file.
1 //
2 // varargs.h
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // XENIX-style macros for accessing arguments of a function which takes a
7 // variable number of arguments. Use the C Standard <stdarg.h> instead.
8 //
9 #pragma once
10 #define _INC_VARARGS
11 
12 #include <vcruntime.h>
13 
15 
16 
17 
18 #if __STDC__
19  #error varargs.h incompatible with __STDC__ (use stdarg.h)
20 #endif
21 
22 #ifndef va_arg
23  #if defined _M_CEE
24  #error varargs.h not supported when targeting _M_CEE (use stdarg.h)
25  #endif
26 
27  #define va_dcl va_list va_alist;
28  #define va_arg __crt_va_arg
29  #define va_end __crt_va_end
30 
31  #if defined _M_IX86 || defined _M_ARM
32  #define va_start(ap) ((void)(ap = (va_list)&va_alist))
33  #elif defined _M_X64
34  #define va_start(ap) ((void)(__va_start(&ap, 0)))
35  #elif defined _M_ARM64
36  #define va_start(ap) ((void)(__va_start(&ap, 0, 0, 0, 0)))
37  #else
38  #error Unsupported architecture
39  #endif
40 #endif // va_arg
41 
42 
43 
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:73
#define _CRT_END_C_HEADER
Definition: vcruntime.h:76