VirtualBox

source: vbox/trunk/src/bldprogs/test-gccplugin-2.c@ 69355

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. */
2extern void MyIprtPrintf(const char *pszFormat, ...) __attribute__((__iprt_format__(1,2)));
3extern void foo(void);
4
5extern unsigned long long g_ull;
6
7typedef unsigned long long RTGCPHYS;
8extern RTGCPHYS g_GCPhys;
9
10typedef RTGCPHYS *PRTGCPHYS;
11extern PRTGCPHYS g_pGCPhys;
12
13#include <stdarg.h>
14
15void 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.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette