Last change
on this file since 69355 was 69091, checked in by vboxsync, 7 years ago |
gccplugin: va_arg workaround
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
801 bytes
|
Line | |
---|
1 | /* Only valid stuff in this one. */
|
---|
2 | extern void MyIprtPrintf(const char *pszFormat, ...) __attribute__((__iprt_format__(1,2)));
|
---|
3 | extern void foo(void);
|
---|
4 |
|
---|
5 | extern unsigned long long g_ull;
|
---|
6 |
|
---|
7 | typedef unsigned long long RTGCPHYS;
|
---|
8 | extern RTGCPHYS g_GCPhys;
|
---|
9 |
|
---|
10 | typedef RTGCPHYS *PRTGCPHYS;
|
---|
11 | extern PRTGCPHYS g_pGCPhys;
|
---|
12 |
|
---|
13 | #include <stdarg.h>
|
---|
14 |
|
---|
15 | void foo(const char *pszFormat, ...)
|
---|
16 | {
|
---|
17 | MyIprtPrintf("%s %RX64 %RGp %p %RGp", "foobar", g_ull, g_GCPhys, g_pGCPhys, *g_pGCPhys);
|
---|
18 | MyIprtPrintf("%RX32 %d %s\n", 10, 42, "string");
|
---|
19 | MyIprtPrintf("%u %.8Rhxs %d\n", 10, &g_ull, 42);
|
---|
20 | MyIprtPrintf("%u %.8RhxD %d\n", 10, &g_ull, 42);
|
---|
21 | {
|
---|
22 | va_list va;
|
---|
23 | int iValue;
|
---|
24 | va_start(va, pszFormat);
|
---|
25 | iValue = va_arg(va, int);
|
---|
26 | va_end(va);
|
---|
27 | MyIprtPrintf("%u\n", iValue);
|
---|
28 | }
|
---|
29 | }
|
---|
30 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.