Commit 001faf3269541f0231482e0fccc846f62f8930b2

Authored by Blue Swirl
1 parent 4cfce484

Replace gcc variadic macro extension with C99 version

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
block-raw-posix.c
@@ -73,10 +73,10 @@ @@ -73,10 +73,10 @@
73 73
74 //#define DEBUG_BLOCK 74 //#define DEBUG_BLOCK
75 #if defined(DEBUG_BLOCK) 75 #if defined(DEBUG_BLOCK)
76 -#define DEBUG_BLOCK_PRINT(formatCstr, args...) do { if (qemu_log_enabled()) \  
77 - { qemu_log(formatCstr, ##args); qemu_log_flush(); } } while (0) 76 +#define DEBUG_BLOCK_PRINT(formatCstr, ...) do { if (qemu_log_enabled()) \
  77 + { qemu_log(formatCstr, ## __VA_ARGS__); qemu_log_flush(); } } while (0)
78 #else 78 #else
79 -#define DEBUG_BLOCK_PRINT(formatCstr, args...) 79 +#define DEBUG_BLOCK_PRINT(formatCstr, ...)
80 #endif 80 #endif
81 81
82 /* OS X does not have O_DSYNC */ 82 /* OS X does not have O_DSYNC */
darwin-user/main.c
@@ -158,12 +158,12 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val) @@ -158,12 +158,12 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val)
158 return -1; 158 return -1;
159 } 159 }
160 160
161 -#define EXCP_DUMP(env, fmt, args...) \  
162 -do { \  
163 - fprintf(stderr, fmt , ##args); \  
164 - cpu_dump_state(env, stderr, fprintf, 0); \  
165 - qemu_log(fmt, ##args); \  
166 - log_cpu_state(env, 0); \ 161 +#define EXCP_DUMP(env, fmt, ...) \
  162 +do { \
  163 + fprintf(stderr, fmt , ## __VA_ARGS__); \
  164 + cpu_dump_state(env, stderr, fprintf, 0); \
  165 + qemu_log(fmt, ## __VA_ARGS__); \
  166 + log_cpu_state(env, 0); \
167 } while (0) 167 } while (0)
168 168
169 void cpu_loop(CPUPPCState *env) 169 void cpu_loop(CPUPPCState *env)
darwin-user/syscall.c
@@ -627,7 +627,7 @@ static inline void byteswap_winsize(struct winsize *w) @@ -627,7 +627,7 @@ static inline void byteswap_winsize(struct winsize *w)
627 tswap16s(&w->ws_ypixel); 627 tswap16s(&w->ws_ypixel);
628 } 628 }
629 629
630 -#define STRUCT(name, list...) STRUCT_ ## name, 630 +#define STRUCT(name, ...) STRUCT_ ## name,
631 #define STRUCT_SPECIAL(name) STRUCT_ ## name, 631 #define STRUCT_SPECIAL(name) STRUCT_ ## name,
632 enum { 632 enum {
633 #include "ioctls_types.h" 633 #include "ioctls_types.h"
@@ -635,7 +635,7 @@ enum { @@ -635,7 +635,7 @@ enum {
635 #undef STRUCT 635 #undef STRUCT
636 #undef STRUCT_SPECIAL 636 #undef STRUCT_SPECIAL
637 637
638 -#define STRUCT(name, list...) const argtype struct_ ## name ## _def[] = { list, TYPE_NULL }; 638 +#define STRUCT(name, ...) const argtype struct_ ## name ## _def[] = { __VA_ARGS__, TYPE_NULL };
639 #define STRUCT_SPECIAL(name) 639 #define STRUCT_SPECIAL(name)
640 #include "ioctls_types.h" 640 #include "ioctls_types.h"
641 #undef STRUCT 641 #undef STRUCT
@@ -656,8 +656,8 @@ typedef struct IOCTLEntry { @@ -656,8 +656,8 @@ typedef struct IOCTLEntry {
656 #define MAX_STRUCT_SIZE 4096 656 #define MAX_STRUCT_SIZE 4096
657 657
658 static IOCTLEntry ioctl_entries[] = { 658 static IOCTLEntry ioctl_entries[] = {
659 -#define IOCTL(cmd, access, types...) \  
660 - { cmd, cmd, #cmd, access, { types } }, 659 +#define IOCTL(cmd, access, ...) \
  660 + { cmd, cmd, #cmd, access, { __VA_ARGS__ } },
661 #include "ioctls.h" 661 #include "ioctls.h"
662 { 0, 0, }, 662 { 0, 0, },
663 }; 663 };
@@ -898,10 +898,10 @@ typedef long (*syscall_function_t)(void *cpu_env, int num); @@ -898,10 +898,10 @@ typedef long (*syscall_function_t)(void *cpu_env, int num);
898 #define WRAPPER_CALL_DIRECT_6(function, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) long __qemu_##function(void *cpu_env) { int i = 0; typeof(_arg1) arg1 = _arg1; typeof(_arg2) arg2 = _arg2; typeof(_arg3) arg3 = _arg3; typeof(_arg4) arg4 = _arg4; typeof(_arg5) arg5 = _arg5; typeof(_arg6) arg6 = _arg6; return (long)function(arg1, arg2, arg3, arg4, arg5, arg6); } 898 #define WRAPPER_CALL_DIRECT_6(function, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6) long __qemu_##function(void *cpu_env) { int i = 0; typeof(_arg1) arg1 = _arg1; typeof(_arg2) arg2 = _arg2; typeof(_arg3) arg3 = _arg3; typeof(_arg4) arg4 = _arg4; typeof(_arg5) arg5 = _arg5; typeof(_arg6) arg6 = _arg6; return (long)function(arg1, arg2, arg3, arg4, arg5, arg6); }
899 #define WRAPPER_CALL_DIRECT_7(function, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) long __qemu_##function(void *cpu_env) { int i = 0; typeof(_arg1) arg1 = _arg1; typeof(_arg2) arg2 = _arg2; typeof(_arg3) arg3 = _arg3; typeof(_arg4) arg4 = _arg4; typeof(_arg5) arg5 = _arg5; typeof(_arg6) arg6 = _arg6; typeof(_arg7) arg7 = _arg7; return (long)function(arg1, arg2, arg3, arg4, arg5, arg6, arg7); } 899 #define WRAPPER_CALL_DIRECT_7(function, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7) long __qemu_##function(void *cpu_env) { int i = 0; typeof(_arg1) arg1 = _arg1; typeof(_arg2) arg2 = _arg2; typeof(_arg3) arg3 = _arg3; typeof(_arg4) arg4 = _arg4; typeof(_arg5) arg5 = _arg5; typeof(_arg6) arg6 = _arg6; typeof(_arg7) arg7 = _arg7; return (long)function(arg1, arg2, arg3, arg4, arg5, arg6, arg7); }
900 #define WRAPPER_CALL_DIRECT_8(function, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) long __qemu_##function(void *cpu_env) { int i = 0; typeof(_arg1) arg1 = _arg1; typeof(_arg2) arg2 = _arg2; typeof(_arg3) arg3 = _arg3; typeof(_arg4) arg4 = _arg4; typeof(_arg5) arg5 = _arg5; typeof(_arg6) arg6 = _arg6; typeof(_arg7) arg7 = _arg7; typeof(_arg8) arg8 = _arg8; return (long)function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); } 900 #define WRAPPER_CALL_DIRECT_8(function, _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8) long __qemu_##function(void *cpu_env) { int i = 0; typeof(_arg1) arg1 = _arg1; typeof(_arg2) arg2 = _arg2; typeof(_arg3) arg3 = _arg3; typeof(_arg4) arg4 = _arg4; typeof(_arg5) arg5 = _arg5; typeof(_arg6) arg6 = _arg6; typeof(_arg7) arg7 = _arg7; typeof(_arg8) arg8 = _arg8; return (long)function(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); }
901 -#define WRAPPER_CALL_DIRECT(function, nargs, args...) WRAPPER_CALL_DIRECT_##nargs(function, args)  
902 -#define WRAPPER_CALL_NOERRNO(function, nargs, args...) WRAPPER_CALL_DIRECT(function, nargs, args)  
903 -#define WRAPPER_CALL_INDIRECT(function, nargs, args...)  
904 -#define ENTRY(name, number, function, nargs, call_type, args...) WRAPPER_##call_type(function, nargs, args) 901 +#define WRAPPER_CALL_DIRECT(function, nargs, ...) WRAPPER_CALL_DIRECT_##nargs(function, __VA_ARGS__)
  902 +#define WRAPPER_CALL_NOERRNO(function, nargs, ...) WRAPPER_CALL_DIRECT(function, nargs, __VA_ARGS__)
  903 +#define WRAPPER_CALL_INDIRECT(function, nargs, ...)
  904 +#define ENTRY(name, number, function, nargs, call_type, ...) WRAPPER_##call_type(function, nargs, __VA_ARGS__)
905 905
906 #include "syscalls.h" 906 #include "syscalls.h"
907 907
@@ -926,7 +926,7 @@ typedef long (*syscall_function_t)(void *cpu_env, int num); @@ -926,7 +926,7 @@ typedef long (*syscall_function_t)(void *cpu_env, int num);
926 #define ENTRY_CALL_DIRECT(name, number, function, nargs, call_type) _ENTRY(name, number, __qemu_##function, nargs, call_type) 926 #define ENTRY_CALL_DIRECT(name, number, function, nargs, call_type) _ENTRY(name, number, __qemu_##function, nargs, call_type)
927 #define ENTRY_CALL_NOERRNO(name, number, function, nargs, call_type) ENTRY_CALL_DIRECT(name, number, function, nargs, call_type) 927 #define ENTRY_CALL_NOERRNO(name, number, function, nargs, call_type) ENTRY_CALL_DIRECT(name, number, function, nargs, call_type)
928 #define ENTRY_CALL_INDIRECT(name, number, function, nargs, call_type) _ENTRY(name, number, function, nargs, call_type) 928 #define ENTRY_CALL_INDIRECT(name, number, function, nargs, call_type) _ENTRY(name, number, function, nargs, call_type)
929 -#define ENTRY(name, number, function, nargs, call_type, args...) ENTRY_##call_type(name, number, function, nargs, call_type) 929 +#define ENTRY(name, number, function, nargs, call_type, ...) ENTRY_##call_type(name, number, function, nargs, call_type)
930 930
931 #define CALL_DIRECT 1 931 #define CALL_DIRECT 1
932 #define CALL_INDIRECT 2 932 #define CALL_INDIRECT 2
hw/adb.c
@@ -29,10 +29,10 @@ @@ -29,10 +29,10 @@
29 //#define DEBUG_ADB 29 //#define DEBUG_ADB
30 30
31 #ifdef DEBUG_ADB 31 #ifdef DEBUG_ADB
32 -#define ADB_DPRINTF(fmt, args...) \  
33 -do { printf("ADB: " fmt , ##args); } while (0) 32 +#define ADB_DPRINTF(fmt, ...) \
  33 +do { printf("ADB: " fmt , ## __VA_ARGS__); } while (0)
34 #else 34 #else
35 -#define ADB_DPRINTF(fmt, args...) 35 +#define ADB_DPRINTF(fmt, ...)
36 #endif 36 #endif
37 37
38 /* ADB commands */ 38 /* ADB commands */
hw/apb_pci.c
@@ -33,10 +33,10 @@ @@ -33,10 +33,10 @@
33 //#define DEBUG_APB 33 //#define DEBUG_APB
34 34
35 #ifdef DEBUG_APB 35 #ifdef DEBUG_APB
36 -#define APB_DPRINTF(fmt, args...) \  
37 -do { printf("APB: " fmt , ##args); } while (0) 36 +#define APB_DPRINTF(fmt, ...) \
  37 +do { printf("APB: " fmt , ## __VA_ARGS__); } while (0)
38 #else 38 #else
39 -#define APB_DPRINTF(fmt, args...) 39 +#define APB_DPRINTF(fmt, ...)
40 #endif 40 #endif
41 41
42 typedef target_phys_addr_t pci_addr_t; 42 typedef target_phys_addr_t pci_addr_t;
hw/arm_gic.c
@@ -14,10 +14,10 @@ @@ -14,10 +14,10 @@
14 //#define DEBUG_GIC 14 //#define DEBUG_GIC
15 15
16 #ifdef DEBUG_GIC 16 #ifdef DEBUG_GIC
17 -#define DPRINTF(fmt, args...) \  
18 -do { printf("arm_gic: " fmt , ##args); } while (0) 17 +#define DPRINTF(fmt, ...) \
  18 +do { printf("arm_gic: " fmt , ## __VA_ARGS__); } while (0)
19 #else 19 #else
20 -#define DPRINTF(fmt, args...) do {} while(0) 20 +#define DPRINTF(fmt, ...) do {} while(0)
21 #endif 21 #endif
22 22
23 #ifdef NVIC 23 #ifdef NVIC
hw/cs4231.c
@@ -46,10 +46,10 @@ typedef struct CSState { @@ -46,10 +46,10 @@ typedef struct CSState {
46 #define CS_CDC_VER 0x8a 46 #define CS_CDC_VER 0x8a
47 47
48 #ifdef DEBUG_CS 48 #ifdef DEBUG_CS
49 -#define DPRINTF(fmt, args...) \  
50 - do { printf("CS: " fmt , ##args); } while (0) 49 +#define DPRINTF(fmt, ...) \
  50 + do { printf("CS: " fmt , ## __VA_ARGS__); } while (0)
51 #else 51 #else
52 -#define DPRINTF(fmt, args...) 52 +#define DPRINTF(fmt, ...)
53 #endif 53 #endif
54 54
55 static void cs_reset(void *opaque) 55 static void cs_reset(void *opaque)
hw/cuda.c
@@ -36,10 +36,10 @@ @@ -36,10 +36,10 @@
36 //#define DEBUG_CUDA_PACKET 36 //#define DEBUG_CUDA_PACKET
37 37
38 #ifdef DEBUG_CUDA 38 #ifdef DEBUG_CUDA
39 -#define CUDA_DPRINTF(fmt, args...) \  
40 -do { printf("CUDA: " fmt , ##args); } while (0) 39 +#define CUDA_DPRINTF(fmt, ...) \
  40 + do { printf("CUDA: " fmt , ## __VA_ARGS__); } while (0)
41 #else 41 #else
42 -#define CUDA_DPRINTF(fmt, args...) 42 +#define CUDA_DPRINTF(fmt, ...)
43 #endif 43 #endif
44 44
45 /* Bits in B data register: all active low */ 45 /* Bits in B data register: all active low */
hw/dp8393x.c
@@ -34,8 +34,8 @@ @@ -34,8 +34,8 @@
34 #endif 34 #endif
35 35
36 #ifdef DEBUG_SONIC 36 #ifdef DEBUG_SONIC
37 -#define DPRINTF(fmt, args...) \  
38 -do { printf("sonic: " fmt , ##args); } while (0) 37 +#define DPRINTF(fmt, ...) \
  38 +do { printf("sonic: " fmt , ## __VA_ARGS__); } while (0)
39 static const char* reg_names[] = { 39 static const char* reg_names[] = {
40 "CR", "DCR", "RCR", "TCR", "IMR", "ISR", "UTDA", "CTDA", 40 "CR", "DCR", "RCR", "TCR", "IMR", "ISR", "UTDA", "CTDA",
41 "TPS", "TFC", "TSA0", "TSA1", "TFS", "URDA", "CRDA", "CRBA0", 41 "TPS", "TFC", "TSA0", "TSA1", "TFS", "URDA", "CRDA", "CRBA0",
@@ -46,11 +46,11 @@ static const char* reg_names[] = { @@ -46,11 +46,11 @@ static const char* reg_names[] = {
46 "0x30", "0x31", "0x32", "0x33", "0x34", "0x35", "0x36", "0x37", 46 "0x30", "0x31", "0x32", "0x33", "0x34", "0x35", "0x36", "0x37",
47 "0x38", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "DCR2" }; 47 "0x38", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "DCR2" };
48 #else 48 #else
49 -#define DPRINTF(fmt, args...) do {} while (0) 49 +#define DPRINTF(fmt, ...) do {} while (0)
50 #endif 50 #endif
51 51
52 -#define SONIC_ERROR(fmt, args...) \  
53 -do { printf("sonic ERROR: %s: " fmt, __func__ , ##args); } while (0) 52 +#define SONIC_ERROR(fmt, ...) \
  53 +do { printf("sonic ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
54 54
55 #define SONIC_CR 0x00 55 #define SONIC_CR 0x00
56 #define SONIC_DCR 0x01 56 #define SONIC_DCR 0x01
hw/eccmemctl.c
@@ -28,10 +28,10 @@ @@ -28,10 +28,10 @@
28 //#define DEBUG_ECC 28 //#define DEBUG_ECC
29 29
30 #ifdef DEBUG_ECC 30 #ifdef DEBUG_ECC
31 -#define DPRINTF(fmt, args...) \  
32 - do { printf("ECC: " fmt , ##args); } while (0) 31 +#define DPRINTF(fmt, ...) \
  32 + do { printf("ECC: " fmt , ## __VA_ARGS__); } while (0)
33 #else 33 #else
34 -#define DPRINTF(fmt, args...) 34 +#define DPRINTF(fmt, ...)
35 #endif 35 #endif
36 36
37 /* There are 3 versions of this chip used in SMP sun4m systems: 37 /* There are 3 versions of this chip used in SMP sun4m systems:
hw/eepro100.c
@@ -60,9 +60,9 @@ @@ -60,9 +60,9 @@
60 //~ #define DEBUG_EEPRO100 60 //~ #define DEBUG_EEPRO100
61 61
62 #ifdef DEBUG_EEPRO100 62 #ifdef DEBUG_EEPRO100
63 -#define logout(fmt, args...) fprintf(stderr, "EE100\t%-24s" fmt, __func__, ##args) 63 +#define logout(fmt, ...) fprintf(stderr, "EE100\t%-24s" fmt, __func__, ## __VA_ARGS__)
64 #else 64 #else
65 -#define logout(fmt, args...) ((void)0) 65 +#define logout(fmt, ...) ((void)0)
66 #endif 66 #endif
67 67
68 /* Set flags to 0 to disable debug output. */ 68 /* Set flags to 0 to disable debug output. */
hw/eeprom93xx.c
@@ -44,9 +44,9 @@ @@ -44,9 +44,9 @@
44 //~ #define DEBUG_EEPROM 44 //~ #define DEBUG_EEPROM
45 45
46 #ifdef DEBUG_EEPROM 46 #ifdef DEBUG_EEPROM
47 -#define logout(fmt, args...) fprintf(stderr, "EEPROM\t%-24s" fmt, __func__, ##args) 47 +#define logout(fmt, ...) fprintf(stderr, "EEPROM\t%-24s" fmt, __func__, ## __VA_ARGS__)
48 #else 48 #else
49 -#define logout(fmt, args...) ((void)0) 49 +#define logout(fmt, ...) ((void)0)
50 #endif 50 #endif
51 51
52 #define EEPROM_INSTANCE 0 52 #define EEPROM_INSTANCE 0
hw/escc.c
@@ -62,22 +62,22 @@ @@ -62,22 +62,22 @@
62 */ 62 */
63 63
64 #ifdef DEBUG_SERIAL 64 #ifdef DEBUG_SERIAL
65 -#define SER_DPRINTF(fmt, args...) \  
66 -do { printf("SER: " fmt , ##args); } while (0) 65 +#define SER_DPRINTF(fmt, ...) \
  66 + do { printf("SER: " fmt , ## __VA_ARGS__); } while (0)
67 #else 67 #else
68 -#define SER_DPRINTF(fmt, args...) 68 +#define SER_DPRINTF(fmt, ...)
69 #endif 69 #endif
70 #ifdef DEBUG_KBD 70 #ifdef DEBUG_KBD
71 -#define KBD_DPRINTF(fmt, args...) \  
72 -do { printf("KBD: " fmt , ##args); } while (0) 71 +#define KBD_DPRINTF(fmt, ...) \
  72 + do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0)
73 #else 73 #else
74 -#define KBD_DPRINTF(fmt, args...) 74 +#define KBD_DPRINTF(fmt, ...)
75 #endif 75 #endif
76 #ifdef DEBUG_MOUSE 76 #ifdef DEBUG_MOUSE
77 -#define MS_DPRINTF(fmt, args...) \  
78 -do { printf("MSC: " fmt , ##args); } while (0) 77 +#define MS_DPRINTF(fmt, ...) \
  78 + do { printf("MSC: " fmt , ## __VA_ARGS__); } while (0)
79 #else 79 #else
80 -#define MS_DPRINTF(fmt, args...) 80 +#define MS_DPRINTF(fmt, ...)
81 #endif 81 #endif
82 82
83 typedef enum { 83 typedef enum {
hw/esp.c
@@ -38,14 +38,14 @@ @@ -38,14 +38,14 @@
38 */ 38 */
39 39
40 #ifdef DEBUG_ESP 40 #ifdef DEBUG_ESP
41 -#define DPRINTF(fmt, args...) \  
42 -do { printf("ESP: " fmt , ##args); } while (0) 41 +#define DPRINTF(fmt, ...) \
  42 + do { printf("ESP: " fmt , ## __VA_ARGS__); } while (0)
43 #else 43 #else
44 -#define DPRINTF(fmt, args...) do {} while (0) 44 +#define DPRINTF(fmt, ...) do {} while (0)
45 #endif 45 #endif
46 46
47 -#define ESP_ERROR(fmt, args...) \  
48 -do { printf("ESP ERROR: %s: " fmt, __func__ , ##args); } while (0) 47 +#define ESP_ERROR(fmt, ...) \
  48 + do { printf("ESP ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
49 49
50 #define ESP_REGS 16 50 #define ESP_REGS 16
51 #define TI_BUFSZ 16 51 #define TI_BUFSZ 16
hw/fdc.c
@@ -37,14 +37,14 @@ @@ -37,14 +37,14 @@
37 //#define DEBUG_FLOPPY 37 //#define DEBUG_FLOPPY
38 38
39 #ifdef DEBUG_FLOPPY 39 #ifdef DEBUG_FLOPPY
40 -#define FLOPPY_DPRINTF(fmt, args...) \  
41 -do { printf("FLOPPY: " fmt , ##args); } while (0) 40 +#define FLOPPY_DPRINTF(fmt, ...) \
  41 + do { printf("FLOPPY: " fmt , ## __VA_ARGS__); } while (0)
42 #else 42 #else
43 -#define FLOPPY_DPRINTF(fmt, args...) 43 +#define FLOPPY_DPRINTF(fmt, ...)
44 #endif 44 #endif
45 45
46 -#define FLOPPY_ERROR(fmt, args...) \  
47 -do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ##args); } while (0) 46 +#define FLOPPY_ERROR(fmt, ...) \
  47 + do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
48 48
49 /********************************************************/ 49 /********************************************************/
50 /* Floppy drive emulation */ 50 /* Floppy drive emulation */
hw/fw_cfg.c
@@ -30,10 +30,10 @@ @@ -30,10 +30,10 @@
30 //#define DEBUG_FW_CFG 30 //#define DEBUG_FW_CFG
31 31
32 #ifdef DEBUG_FW_CFG 32 #ifdef DEBUG_FW_CFG
33 -#define FW_CFG_DPRINTF(fmt, args...) \  
34 - do { printf("FW_CFG: " fmt , ##args); } while (0) 33 +#define FW_CFG_DPRINTF(fmt, ...) \
  34 + do { printf("FW_CFG: " fmt , ## __VA_ARGS__); } while (0)
35 #else 35 #else
36 -#define FW_CFG_DPRINTF(fmt, args...) 36 +#define FW_CFG_DPRINTF(fmt, ...)
37 #endif 37 #endif
38 38
39 #define FW_CFG_SIZE 2 39 #define FW_CFG_SIZE 2
hw/g364fb.c
@@ -26,13 +26,13 @@ @@ -26,13 +26,13 @@
26 //#define DEBUG_G364 26 //#define DEBUG_G364
27 27
28 #ifdef DEBUG_G364 28 #ifdef DEBUG_G364
29 -#define DPRINTF(fmt, args...) \  
30 -do { printf("g364: " fmt , ##args); } while (0) 29 +#define DPRINTF(fmt, ...) \
  30 +do { printf("g364: " fmt , ## __VA_ARGS__); } while (0)
31 #else 31 #else
32 -#define DPRINTF(fmt, args...) do {} while (0) 32 +#define DPRINTF(fmt, ...) do {} while (0)
33 #endif 33 #endif
34 -#define BADF(fmt, args...) \  
35 -do { fprintf(stderr, "g364 ERROR: " fmt , ##args);} while (0) 34 +#define BADF(fmt, ...) \
  35 +do { fprintf(stderr, "g364 ERROR: " fmt , ## __VA_ARGS__);} while (0)
36 36
37 typedef struct G364State { 37 typedef struct G364State {
38 /* hardware */ 38 /* hardware */
hw/grackle_pci.c
@@ -31,10 +31,10 @@ @@ -31,10 +31,10 @@
31 //#define DEBUG_GRACKLE 31 //#define DEBUG_GRACKLE
32 32
33 #ifdef DEBUG_GRACKLE 33 #ifdef DEBUG_GRACKLE
34 -#define GRACKLE_DPRINTF(fmt, args...) \  
35 -do { printf("GRACKLE: " fmt , ##args); } while (0) 34 +#define GRACKLE_DPRINTF(fmt, ...) \
  35 + do { printf("GRACKLE: " fmt , ## __VA_ARGS__); } while (0)
36 #else 36 #else
37 -#define GRACKLE_DPRINTF(fmt, args...) 37 +#define GRACKLE_DPRINTF(fmt, ...)
38 #endif 38 #endif
39 39
40 typedef target_phys_addr_t pci_addr_t; 40 typedef target_phys_addr_t pci_addr_t;
hw/heathrow_pic.c
@@ -29,10 +29,10 @@ @@ -29,10 +29,10 @@
29 //#define DEBUG_PIC 29 //#define DEBUG_PIC
30 30
31 #ifdef DEBUG_PIC 31 #ifdef DEBUG_PIC
32 -#define PIC_DPRINTF(fmt, args...) \  
33 -do { printf("PIC: " fmt , ##args); } while (0) 32 +#define PIC_DPRINTF(fmt, ...) \
  33 + do { printf("PIC: " fmt , ## __VA_ARGS__); } while (0)
34 #else 34 #else
35 -#define PIC_DPRINTF(fmt, args...) 35 +#define PIC_DPRINTF(fmt, ...)
36 #endif 36 #endif
37 37
38 typedef struct HeathrowPIC { 38 typedef struct HeathrowPIC {
hw/iommu.c
@@ -28,10 +28,10 @@ @@ -28,10 +28,10 @@
28 //#define DEBUG_IOMMU 28 //#define DEBUG_IOMMU
29 29
30 #ifdef DEBUG_IOMMU 30 #ifdef DEBUG_IOMMU
31 -#define DPRINTF(fmt, args...) \  
32 -do { printf("IOMMU: " fmt , ##args); } while (0) 31 +#define DPRINTF(fmt, ...) \
  32 + do { printf("IOMMU: " fmt , ## __VA_ARGS__); } while (0)
33 #else 33 #else
34 -#define DPRINTF(fmt, args...) 34 +#define DPRINTF(fmt, ...)
35 #endif 35 #endif
36 36
37 #define IOMMU_NREGS (4*4096/4) 37 #define IOMMU_NREGS (4*4096/4)
hw/lsi53c895a.c
@@ -19,14 +19,14 @@ @@ -19,14 +19,14 @@
19 //#define DEBUG_LSI_REG 19 //#define DEBUG_LSI_REG
20 20
21 #ifdef DEBUG_LSI 21 #ifdef DEBUG_LSI
22 -#define DPRINTF(fmt, args...) \  
23 -do { printf("lsi_scsi: " fmt , ##args); } while (0)  
24 -#define BADF(fmt, args...) \  
25 -do { fprintf(stderr, "lsi_scsi: error: " fmt , ##args); exit(1);} while (0) 22 +#define DPRINTF(fmt, ...) \
  23 +do { printf("lsi_scsi: " fmt , ## __VA_ARGS__); } while (0)
  24 +#define BADF(fmt, ...) \
  25 +do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
26 #else 26 #else
27 -#define DPRINTF(fmt, args...) do {} while(0)  
28 -#define BADF(fmt, args...) \  
29 -do { fprintf(stderr, "lsi_scsi: error: " fmt , ##args);} while (0) 27 +#define DPRINTF(fmt, ...) do {} while(0)
  28 +#define BADF(fmt, ...) \
  29 +do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__);} while (0)
30 #endif 30 #endif
31 31
32 #define LSI_SCNTL0_TRG 0x01 32 #define LSI_SCNTL0_TRG 0x01
hw/m48t59.c
@@ -30,9 +30,9 @@ @@ -30,9 +30,9 @@
30 //#define DEBUG_NVRAM 30 //#define DEBUG_NVRAM
31 31
32 #if defined(DEBUG_NVRAM) 32 #if defined(DEBUG_NVRAM)
33 -#define NVRAM_PRINTF(fmt, args...) do { printf(fmt , ##args); } while (0) 33 +#define NVRAM_PRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0)
34 #else 34 #else
35 -#define NVRAM_PRINTF(fmt, args...) do { } while (0) 35 +#define NVRAM_PRINTF(fmt, ...) do { } while (0)
36 #endif 36 #endif
37 37
38 /* 38 /*
hw/mac_dbdma.c
@@ -44,10 +44,10 @@ @@ -44,10 +44,10 @@
44 //#define DEBUG_DBDMA 44 //#define DEBUG_DBDMA
45 45
46 #ifdef DEBUG_DBDMA 46 #ifdef DEBUG_DBDMA
47 -#define DBDMA_DPRINTF(fmt, args...) \  
48 -do { printf("DBDMA: " fmt , ##args); } while (0) 47 +#define DBDMA_DPRINTF(fmt, ...) \
  48 + do { printf("DBDMA: " fmt , ## __VA_ARGS__); } while (0)
49 #else 49 #else
50 -#define DBDMA_DPRINTF(fmt, args...) 50 +#define DBDMA_DPRINTF(fmt, ...)
51 #endif 51 #endif
52 52
53 /* 53 /*
hw/mac_nvram.c
@@ -31,10 +31,10 @@ @@ -31,10 +31,10 @@
31 //#define DEBUG_NVR 31 //#define DEBUG_NVR
32 32
33 #ifdef DEBUG_NVR 33 #ifdef DEBUG_NVR
34 -#define NVR_DPRINTF(fmt, args...) \  
35 -do { printf("NVR: " fmt , ##args); } while (0) 34 +#define NVR_DPRINTF(fmt, ...) \
  35 + do { printf("NVR: " fmt , ## __VA_ARGS__); } while (0)
36 #else 36 #else
37 -#define NVR_DPRINTF(fmt, args...) 37 +#define NVR_DPRINTF(fmt, ...)
38 #endif 38 #endif
39 39
40 struct MacIONVRAMState { 40 struct MacIONVRAMState {
hw/mcf_fec.c
@@ -14,10 +14,10 @@ @@ -14,10 +14,10 @@
14 //#define DEBUG_FEC 1 14 //#define DEBUG_FEC 1
15 15
16 #ifdef DEBUG_FEC 16 #ifdef DEBUG_FEC
17 -#define DPRINTF(fmt, args...) \  
18 -do { printf("mcf_fec: " fmt , ##args); } while (0) 17 +#define DPRINTF(fmt, ...) \
  18 +do { printf("mcf_fec: " fmt , ## __VA_ARGS__); } while (0)
19 #else 19 #else
20 -#define DPRINTF(fmt, args...) do {} while(0) 20 +#define DPRINTF(fmt, ...) do {} while(0)
21 #endif 21 #endif
22 22
23 #define FEC_MAX_FRAME_SIZE 2032 23 #define FEC_MAX_FRAME_SIZE 2032
hw/mips_malta.c
@@ -114,9 +114,9 @@ static void malta_fpga_update_display(void *opaque) @@ -114,9 +114,9 @@ static void malta_fpga_update_display(void *opaque)
114 //~ #define DEBUG 114 //~ #define DEBUG
115 115
116 #if defined(DEBUG) 116 #if defined(DEBUG)
117 -# define logout(fmt, args...) fprintf(stderr, "MALTA\t%-24s" fmt, __func__, ##args) 117 +# define logout(fmt, ...) fprintf(stderr, "MALTA\t%-24s" fmt, __func__, ## __VA_ARGS__)
118 #else 118 #else
119 -# define logout(fmt, args...) ((void)0) 119 +# define logout(fmt, ...) ((void)0)
120 #endif 120 #endif
121 121
122 struct _eeprom24c0x_t { 122 struct _eeprom24c0x_t {
hw/openpic.c
@@ -40,9 +40,9 @@ @@ -40,9 +40,9 @@
40 //#define DEBUG_OPENPIC 40 //#define DEBUG_OPENPIC
41 41
42 #ifdef DEBUG_OPENPIC 42 #ifdef DEBUG_OPENPIC
43 -#define DPRINTF(fmt, args...) do { printf(fmt , ##args); } while (0) 43 +#define DPRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0)
44 #else 44 #else
45 -#define DPRINTF(fmt, args...) do { } while (0) 45 +#define DPRINTF(fmt, ...) do { } while (0)
46 #endif 46 #endif
47 47
48 #define USE_MPCxxx /* Intel model is broken, for now */ 48 #define USE_MPCxxx /* Intel model is broken, for now */
hw/parallel.c
@@ -30,9 +30,9 @@ @@ -30,9 +30,9 @@
30 //#define DEBUG_PARALLEL 30 //#define DEBUG_PARALLEL
31 31
32 #ifdef DEBUG_PARALLEL 32 #ifdef DEBUG_PARALLEL
33 -#define pdebug(fmt, arg...) printf("pp: " fmt, ##arg) 33 +#define pdebug(fmt, ...) printf("pp: " fmt, ## __VA_ARGS__)
34 #else 34 #else
35 -#define pdebug(fmt, arg...) ((void)0) 35 +#define pdebug(fmt, ...) ((void)0)
36 #endif 36 #endif
37 37
38 #define PARA_REG_DATA 0 38 #define PARA_REG_DATA 0
hw/pci_host.h
@@ -29,10 +29,10 @@ @@ -29,10 +29,10 @@
29 //#define DEBUG_PCI 29 //#define DEBUG_PCI
30 30
31 #ifdef DEBUG_PCI 31 #ifdef DEBUG_PCI
32 -#define PCI_DPRINTF(fmt, args...) \  
33 -do { printf("pci_host_data: " fmt , ##args); } while (0) 32 +#define PCI_DPRINTF(fmt, ...) \
  33 +do { printf("pci_host_data: " fmt , ## __VA_ARGS__); } while (0)
34 #else 34 #else
35 -#define PCI_DPRINTF(fmt, args...) 35 +#define PCI_DPRINTF(fmt, ...)
36 #endif 36 #endif
37 37
38 typedef struct { 38 typedef struct {
hw/pflash_cfi01.c
@@ -42,20 +42,20 @@ @@ -42,20 +42,20 @@
42 #include "block.h" 42 #include "block.h"
43 #include "qemu-timer.h" 43 #include "qemu-timer.h"
44 44
45 -#define PFLASH_BUG(fmt, args...) \ 45 +#define PFLASH_BUG(fmt, ...) \
46 do { \ 46 do { \
47 - printf("PFLASH: Possible BUG - " fmt, ##args); \ 47 + printf("PFLASH: Possible BUG - " fmt, ## __VA_ARGS__); \
48 exit(1); \ 48 exit(1); \
49 } while(0) 49 } while(0)
50 50
51 /* #define PFLASH_DEBUG */ 51 /* #define PFLASH_DEBUG */
52 #ifdef PFLASH_DEBUG 52 #ifdef PFLASH_DEBUG
53 -#define DPRINTF(fmt, args...) \ 53 +#define DPRINTF(fmt, ...) \
54 do { \ 54 do { \
55 - printf("PFLASH: " fmt , ##args); \ 55 + printf("PFLASH: " fmt , ## __VA_ARGS__); \
56 } while (0) 56 } while (0)
57 #else 57 #else
58 -#define DPRINTF(fmt, args...) do { } while (0) 58 +#define DPRINTF(fmt, ...) do { } while (0)
59 #endif 59 #endif
60 60
61 struct pflash_t { 61 struct pflash_t {
hw/pflash_cfi02.c
@@ -43,12 +43,12 @@ @@ -43,12 +43,12 @@
43 43
44 //#define PFLASH_DEBUG 44 //#define PFLASH_DEBUG
45 #ifdef PFLASH_DEBUG 45 #ifdef PFLASH_DEBUG
46 -#define DPRINTF(fmt, args...) \ 46 +#define DPRINTF(fmt, ...) \
47 do { \ 47 do { \
48 - printf("PFLASH: " fmt , ##args); \ 48 + printf("PFLASH: " fmt , ## __VA_ARGS__); \
49 } while (0) 49 } while (0)
50 #else 50 #else
51 -#define DPRINTF(fmt, args...) do { } while (0) 51 +#define DPRINTF(fmt, ...) do { } while (0)
52 #endif 52 #endif
53 53
54 struct pflash_t { 54 struct pflash_t {
hw/pl022.c
@@ -13,14 +13,14 @@ @@ -13,14 +13,14 @@
13 //#define DEBUG_PL022 1 13 //#define DEBUG_PL022 1
14 14
15 #ifdef DEBUG_PL022 15 #ifdef DEBUG_PL022
16 -#define DPRINTF(fmt, args...) \  
17 -do { printf("pl022: " fmt , ##args); } while (0)  
18 -#define BADF(fmt, args...) \  
19 -do { fprintf(stderr, "pl022: error: " fmt , ##args); exit(1);} while (0) 16 +#define DPRINTF(fmt, ...) \
  17 +do { printf("pl022: " fmt , ## __VA_ARGS__); } while (0)
  18 +#define BADF(fmt, ...) \
  19 +do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
20 #else 20 #else
21 -#define DPRINTF(fmt, args...) do {} while(0)  
22 -#define BADF(fmt, args...) \  
23 -do { fprintf(stderr, "pl022: error: " fmt , ##args);} while (0) 21 +#define DPRINTF(fmt, ...) do {} while(0)
  22 +#define BADF(fmt, ...) \
  23 +do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0)
24 #endif 24 #endif
25 25
26 #define PL022_CR1_LBM 0x01 26 #define PL022_CR1_LBM 0x01
hw/pl031.c
@@ -16,10 +16,10 @@ @@ -16,10 +16,10 @@
16 //#define DEBUG_PL031 16 //#define DEBUG_PL031
17 17
18 #ifdef DEBUG_PL031 18 #ifdef DEBUG_PL031
19 -#define DPRINTF(fmt, args...) \  
20 -do { printf("pl031: " fmt , ##args); } while (0) 19 +#define DPRINTF(fmt, ...) \
  20 +do { printf("pl031: " fmt , ## __VA_ARGS__); } while (0)
21 #else 21 #else
22 -#define DPRINTF(fmt, args...) do {} while(0) 22 +#define DPRINTF(fmt, ...) do {} while(0)
23 #endif 23 #endif
24 24
25 #define RTC_DR 0x00 /* Data read register */ 25 #define RTC_DR 0x00 /* Data read register */
hw/pl061.c
@@ -14,14 +14,14 @@ @@ -14,14 +14,14 @@
14 //#define DEBUG_PL061 1 14 //#define DEBUG_PL061 1
15 15
16 #ifdef DEBUG_PL061 16 #ifdef DEBUG_PL061
17 -#define DPRINTF(fmt, args...) \  
18 -do { printf("pl061: " fmt , ##args); } while (0)  
19 -#define BADF(fmt, args...) \  
20 -do { fprintf(stderr, "pl061: error: " fmt , ##args); exit(1);} while (0) 17 +#define DPRINTF(fmt, ...) \
  18 +do { printf("pl061: " fmt , ## __VA_ARGS__); } while (0)
  19 +#define BADF(fmt, ...) \
  20 +do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
21 #else 21 #else
22 -#define DPRINTF(fmt, args...) do {} while(0)  
23 -#define BADF(fmt, args...) \  
24 -do { fprintf(stderr, "pl061: error: " fmt , ##args);} while (0) 22 +#define DPRINTF(fmt, ...) do {} while(0)
  23 +#define BADF(fmt, ...) \
  24 +do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__);} while (0)
25 #endif 25 #endif
26 26
27 static const uint8_t pl061_id[12] = 27 static const uint8_t pl061_id[12] =
hw/pl181.c
@@ -14,10 +14,10 @@ @@ -14,10 +14,10 @@
14 //#define DEBUG_PL181 1 14 //#define DEBUG_PL181 1
15 15
16 #ifdef DEBUG_PL181 16 #ifdef DEBUG_PL181
17 -#define DPRINTF(fmt, args...) \  
18 -do { printf("pl181: " fmt , ##args); } while (0) 17 +#define DPRINTF(fmt, ...) \
  18 +do { printf("pl181: " fmt , ## __VA_ARGS__); } while (0)
19 #else 19 #else
20 -#define DPRINTF(fmt, args...) do {} while(0) 20 +#define DPRINTF(fmt, ...) do {} while(0)
21 #endif 21 #endif
22 22
23 #define PL181_FIFO_LEN 16 23 #define PL181_FIFO_LEN 16
hw/ppc4xx_pci.c
@@ -33,7 +33,7 @@ typedef target_phys_addr_t pci_addr_t; @@ -33,7 +33,7 @@ typedef target_phys_addr_t pci_addr_t;
33 #ifdef DEBUG 33 #ifdef DEBUG
34 #define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0) 34 #define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)
35 #else 35 #else
36 -#define DPRINTF(fmt, args...) 36 +#define DPRINTF(fmt, ...)
37 #endif /* DEBUG */ 37 #endif /* DEBUG */
38 38
39 struct PCIMasterMap { 39 struct PCIMasterMap {
hw/ppc_newworld.c
@@ -44,10 +44,10 @@ @@ -44,10 +44,10 @@
44 //#define DEBUG_UNIN 44 //#define DEBUG_UNIN
45 45
46 #ifdef DEBUG_UNIN 46 #ifdef DEBUG_UNIN
47 -#define UNIN_DPRINTF(fmt, args...) \  
48 -do { printf("UNIN: " fmt , ##args); } while (0) 47 +#define UNIN_DPRINTF(fmt, ...) \
  48 + do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0)
49 #else 49 #else
50 -#define UNIN_DPRINTF(fmt, args...) 50 +#define UNIN_DPRINTF(fmt, ...)
51 #endif 51 #endif
52 52
53 /* UniN device */ 53 /* UniN device */
hw/ppc_prep.c
@@ -50,18 +50,18 @@ @@ -50,18 +50,18 @@
50 #endif 50 #endif
51 51
52 #if defined (HARD_DEBUG_PPC_IO) 52 #if defined (HARD_DEBUG_PPC_IO)
53 -#define PPC_IO_DPRINTF(fmt, args...) \ 53 +#define PPC_IO_DPRINTF(fmt, ...) \
54 do { \ 54 do { \
55 if (qemu_loglevel_mask(CPU_LOG_IOPORT)) { \ 55 if (qemu_loglevel_mask(CPU_LOG_IOPORT)) { \
56 - qemu_log("%s: " fmt, __func__ , ##args); \ 56 + qemu_log("%s: " fmt, __func__ , ## __VA_ARGS__); \
57 } else { \ 57 } else { \
58 - printf("%s : " fmt, __func__ , ##args); \ 58 + printf("%s : " fmt, __func__ , ## __VA_ARGS__); \
59 } \ 59 } \
60 } while (0) 60 } while (0)
61 #elif defined (DEBUG_PPC_IO) 61 #elif defined (DEBUG_PPC_IO)
62 -#define PPC_IO_DPRINTF(fmt, args...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__) 62 +#define PPC_IO_DPRINTF(fmt, ...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__)
63 #else 63 #else
64 -#define PPC_IO_DPRINTF(fmt, args...) do { } while (0) 64 +#define PPC_IO_DPRINTF(fmt, ...) do { } while (0)
65 #endif 65 #endif
66 66
67 /* Constants for devices init */ 67 /* Constants for devices init */
hw/ppce500_pci.c
@@ -24,9 +24,9 @@ typedef target_phys_addr_t pci_addr_t; @@ -24,9 +24,9 @@ typedef target_phys_addr_t pci_addr_t;
24 #include "qemu-log.h" 24 #include "qemu-log.h"
25 25
26 #ifdef DEBUG_PCI 26 #ifdef DEBUG_PCI
27 -#define pci_debug(fmt, arg...) fprintf(stderr, fmt, ##arg) 27 +#define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
28 #else 28 #else
29 -#define pci_debug(fmt, arg...) 29 +#define pci_debug(fmt, ...)
30 #endif 30 #endif
31 31
32 #define PCIE500_CFGADDR 0x0 32 #define PCIE500_CFGADDR 0x0
hw/rc4030.c
@@ -33,16 +33,16 @@ @@ -33,16 +33,16 @@
33 //#define DEBUG_RC4030_DMA 33 //#define DEBUG_RC4030_DMA
34 34
35 #ifdef DEBUG_RC4030 35 #ifdef DEBUG_RC4030
36 -#define DPRINTF(fmt, args...) \  
37 -do { printf("rc4030: " fmt , ##args); } while (0) 36 +#define DPRINTF(fmt, ...) \
  37 +do { printf("rc4030: " fmt , ## __VA_ARGS__); } while (0)
38 static const char* irq_names[] = { "parallel", "floppy", "sound", "video", 38 static const char* irq_names[] = { "parallel", "floppy", "sound", "video",
39 "network", "scsi", "keyboard", "mouse", "serial0", "serial1" }; 39 "network", "scsi", "keyboard", "mouse", "serial0", "serial1" };
40 #else 40 #else
41 -#define DPRINTF(fmt, args...) 41 +#define DPRINTF(fmt, ...)
42 #endif 42 #endif
43 43
44 -#define RC4030_ERROR(fmt, args...) \  
45 -do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ##args); } while (0) 44 +#define RC4030_ERROR(fmt, ...) \
  45 +do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
46 46
47 /********************************************************/ 47 /********************************************************/
48 /* rc4030 emulation */ 48 /* rc4030 emulation */
hw/sbi.c
@@ -28,10 +28,10 @@ @@ -28,10 +28,10 @@
28 //#define DEBUG_IRQ 28 //#define DEBUG_IRQ
29 29
30 #ifdef DEBUG_IRQ 30 #ifdef DEBUG_IRQ
31 -#define DPRINTF(fmt, args...) \  
32 -do { printf("IRQ: " fmt , ##args); } while (0) 31 +#define DPRINTF(fmt, ...) \
  32 + do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0)
33 #else 33 #else
34 -#define DPRINTF(fmt, args...) 34 +#define DPRINTF(fmt, ...)
35 #endif 35 #endif
36 36
37 #define MAX_CPUS 16 37 #define MAX_CPUS 16
hw/scsi-disk.c
@@ -18,14 +18,14 @@ @@ -18,14 +18,14 @@
18 //#define DEBUG_SCSI 18 //#define DEBUG_SCSI
19 19
20 #ifdef DEBUG_SCSI 20 #ifdef DEBUG_SCSI
21 -#define DPRINTF(fmt, args...) \  
22 -do { printf("scsi-disk: " fmt , ##args); } while (0) 21 +#define DPRINTF(fmt, ...) \
  22 +do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
23 #else 23 #else
24 -#define DPRINTF(fmt, args...) do {} while(0) 24 +#define DPRINTF(fmt, ...) do {} while(0)
25 #endif 25 #endif
26 26
27 -#define BADF(fmt, args...) \  
28 -do { fprintf(stderr, "scsi-disk: " fmt , ##args); } while (0) 27 +#define BADF(fmt, ...) \
  28 +do { fprintf(stderr, "scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
29 29
30 #include "qemu-common.h" 30 #include "qemu-common.h"
31 #include "block.h" 31 #include "block.h"
hw/scsi-generic.c
@@ -28,14 +28,14 @@ SCSIDevice *scsi_generic_init(BlockDriverState *bdrv, int tcq, @@ -28,14 +28,14 @@ SCSIDevice *scsi_generic_init(BlockDriverState *bdrv, int tcq,
28 //#define DEBUG_SCSI 28 //#define DEBUG_SCSI
29 29
30 #ifdef DEBUG_SCSI 30 #ifdef DEBUG_SCSI
31 -#define DPRINTF(fmt, args...) \  
32 -do { printf("scsi-generic: " fmt , ##args); } while (0) 31 +#define DPRINTF(fmt, ...) \
  32 +do { printf("scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
33 #else 33 #else
34 -#define DPRINTF(fmt, args...) do {} while(0) 34 +#define DPRINTF(fmt, ...) do {} while(0)
35 #endif 35 #endif
36 36
37 -#define BADF(fmt, args...) \  
38 -do { fprintf(stderr, "scsi-generic: " fmt , ##args); } while (0) 37 +#define BADF(fmt, ...) \
  38 +do { fprintf(stderr, "scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
39 39
40 #include <stdio.h> 40 #include <stdio.h>
41 #include <sys/types.h> 41 #include <sys/types.h>
@@ -36,10 +36,10 @@ @@ -36,10 +36,10 @@
36 //#define DEBUG_SD 1 36 //#define DEBUG_SD 1
37 37
38 #ifdef DEBUG_SD 38 #ifdef DEBUG_SD
39 -#define DPRINTF(fmt, args...) \  
40 -do { fprintf(stderr, "SD: " fmt , ##args); } while (0) 39 +#define DPRINTF(fmt, ...) \
  40 +do { fprintf(stderr, "SD: " fmt , ## __VA_ARGS__); } while (0)
41 #else 41 #else
42 -#define DPRINTF(fmt, args...) do {} while(0) 42 +#define DPRINTF(fmt, ...) do {} while(0)
43 #endif 43 #endif
44 44
45 typedef enum { 45 typedef enum {
hw/sh_intc.h
@@ -18,7 +18,7 @@ struct intc_group { @@ -18,7 +18,7 @@ struct intc_group {
18 intc_enum enum_ids[32]; 18 intc_enum enum_ids[32];
19 }; 19 };
20 20
21 -#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } } 21 +#define INTC_GROUP(enum_id, ...) { enum_id, { __VA_ARGS__ } }
22 22
23 struct intc_mask_reg { 23 struct intc_mask_reg {
24 unsigned long set_reg, clr_reg, reg_width; 24 unsigned long set_reg, clr_reg, reg_width;
hw/slavio_intctl.c
@@ -29,10 +29,10 @@ @@ -29,10 +29,10 @@
29 //#define DEBUG_IRQ 29 //#define DEBUG_IRQ
30 30
31 #ifdef DEBUG_IRQ 31 #ifdef DEBUG_IRQ
32 -#define DPRINTF(fmt, args...) \  
33 -do { printf("IRQ: " fmt , ##args); } while (0) 32 +#define DPRINTF(fmt, ...) \
  33 + do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0)
34 #else 34 #else
35 -#define DPRINTF(fmt, args...) 35 +#define DPRINTF(fmt, ...)
36 #endif 36 #endif
37 37
38 /* 38 /*
hw/slavio_misc.c
@@ -37,10 +37,10 @@ @@ -37,10 +37,10 @@
37 */ 37 */
38 38
39 #ifdef DEBUG_MISC 39 #ifdef DEBUG_MISC
40 -#define MISC_DPRINTF(fmt, args...) \  
41 -do { printf("MISC: " fmt , ##args); } while (0) 40 +#define MISC_DPRINTF(fmt, ...) \
  41 + do { printf("MISC: " fmt , ## __VA_ARGS__); } while (0)
42 #else 42 #else
43 -#define MISC_DPRINTF(fmt, args...) 43 +#define MISC_DPRINTF(fmt, ...)
44 #endif 44 #endif
45 45
46 typedef struct MiscState { 46 typedef struct MiscState {
hw/slavio_timer.c
@@ -28,10 +28,10 @@ @@ -28,10 +28,10 @@
28 //#define DEBUG_TIMER 28 //#define DEBUG_TIMER
29 29
30 #ifdef DEBUG_TIMER 30 #ifdef DEBUG_TIMER
31 -#define DPRINTF(fmt, args...) \  
32 -do { printf("TIMER: " fmt , ##args); } while (0) 31 +#define DPRINTF(fmt, ...) \
  32 + do { printf("TIMER: " fmt , ## __VA_ARGS__); } while (0)
33 #else 33 #else
34 -#define DPRINTF(fmt, args...) do {} while (0) 34 +#define DPRINTF(fmt, ...) do {} while (0)
35 #endif 35 #endif
36 36
37 /* 37 /*
hw/sm501.c
@@ -47,9 +47,9 @@ @@ -47,9 +47,9 @@
47 //#define DEBUG_BITBLT 47 //#define DEBUG_BITBLT
48 48
49 #ifdef DEBUG_SM501 49 #ifdef DEBUG_SM501
50 -#define SM501_DPRINTF(fmt...) printf(fmt) 50 +#define SM501_DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__)
51 #else 51 #else
52 -#define SM501_DPRINTF(fmt...) do {} while(0) 52 +#define SM501_DPRINTF(fmt, ...) do {} while(0)
53 #endif 53 #endif
54 54
55 55
hw/smbus.c
@@ -16,14 +16,14 @@ @@ -16,14 +16,14 @@
16 //#define DEBUG_SMBUS 1 16 //#define DEBUG_SMBUS 1
17 17
18 #ifdef DEBUG_SMBUS 18 #ifdef DEBUG_SMBUS
19 -#define DPRINTF(fmt, args...) \  
20 -do { printf("smbus(%02x): " fmt , dev->i2c.address, ##args); } while (0)  
21 -#define BADF(fmt, args...) \  
22 -do { fprintf(stderr, "smbus: error: " fmt , ##args); exit(1);} while (0) 19 +#define DPRINTF(fmt, ...) \
  20 +do { printf("smbus(%02x): " fmt , dev->i2c.address, ## __VA_ARGS__); } while (0)
  21 +#define BADF(fmt, ...) \
  22 +do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
23 #else 23 #else
24 -#define DPRINTF(fmt, args...) do {} while(0)  
25 -#define BADF(fmt, args...) \  
26 -do { fprintf(stderr, "smbus: error: " fmt , ##args);} while (0) 24 +#define DPRINTF(fmt, ...) do {} while(0)
  25 +#define BADF(fmt, ...) \
  26 +do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__);} while (0)
27 #endif 27 #endif
28 28
29 enum { 29 enum {
hw/sparc32_dma.c
@@ -37,10 +37,10 @@ @@ -37,10 +37,10 @@
37 */ 37 */
38 38
39 #ifdef DEBUG_DMA 39 #ifdef DEBUG_DMA
40 -#define DPRINTF(fmt, args...) \  
41 -do { printf("DMA: " fmt , ##args); } while (0) 40 +#define DPRINTF(fmt, ...) \
  41 + do { printf("DMA: " fmt , ## __VA_ARGS__); } while (0)
42 #else 42 #else
43 -#define DPRINTF(fmt, args...) 43 +#define DPRINTF(fmt, ...)
44 #endif 44 #endif
45 45
46 #define DMA_REGS 4 46 #define DMA_REGS 4
hw/ssd0303.c
@@ -17,14 +17,14 @@ @@ -17,14 +17,14 @@
17 //#define DEBUG_SSD0303 1 17 //#define DEBUG_SSD0303 1
18 18
19 #ifdef DEBUG_SSD0303 19 #ifdef DEBUG_SSD0303
20 -#define DPRINTF(fmt, args...) \  
21 -do { printf("ssd0303: " fmt , ##args); } while (0)  
22 -#define BADF(fmt, args...) \  
23 -do { fprintf(stderr, "ssd0303: error: " fmt , ##args); exit(1);} while (0) 20 +#define DPRINTF(fmt, ...) \
  21 +do { printf("ssd0303: " fmt , ## __VA_ARGS__); } while (0)
  22 +#define BADF(fmt, ...) \
  23 +do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
24 #else 24 #else
25 -#define DPRINTF(fmt, args...) do {} while(0)  
26 -#define BADF(fmt, args...) \  
27 -do { fprintf(stderr, "ssd0303: error: " fmt , ##args);} while (0) 25 +#define DPRINTF(fmt, ...) do {} while(0)
  26 +#define BADF(fmt, ...) \
  27 +do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__);} while (0)
28 #endif 28 #endif
29 29
30 /* Scaling factor for pixels. */ 30 /* Scaling factor for pixels. */
hw/ssd0323.c
@@ -17,14 +17,14 @@ @@ -17,14 +17,14 @@
17 //#define DEBUG_SSD0323 1 17 //#define DEBUG_SSD0323 1
18 18
19 #ifdef DEBUG_SSD0323 19 #ifdef DEBUG_SSD0323
20 -#define DPRINTF(fmt, args...) \  
21 -do { printf("ssd0323: " fmt , ##args); } while (0)  
22 -#define BADF(fmt, args...) \  
23 -do { fprintf(stderr, "ssd0323: error: " fmt , ##args); exit(1);} while (0) 20 +#define DPRINTF(fmt, ...) \
  21 +do { printf("ssd0323: " fmt , ## __VA_ARGS__); } while (0)
  22 +#define BADF(fmt, ...) \
  23 +do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
24 #else 24 #else
25 -#define DPRINTF(fmt, args...) do {} while(0)  
26 -#define BADF(fmt, args...) \  
27 -do { fprintf(stderr, "ssd0323: error: " fmt , ##args);} while (0) 25 +#define DPRINTF(fmt, ...) do {} while(0)
  26 +#define BADF(fmt, ...) \
  27 +do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__);} while (0)
28 #endif 28 #endif
29 29
30 /* Scaling factor for pixels. */ 30 /* Scaling factor for pixels. */
hw/ssi-sd.c
@@ -13,14 +13,14 @@ @@ -13,14 +13,14 @@
13 //#define DEBUG_SSI_SD 1 13 //#define DEBUG_SSI_SD 1
14 14
15 #ifdef DEBUG_SSI_SD 15 #ifdef DEBUG_SSI_SD
16 -#define DPRINTF(fmt, args...) \  
17 -do { printf("ssi_sd: " fmt , ##args); } while (0)  
18 -#define BADF(fmt, args...) \  
19 -do { fprintf(stderr, "ssi_sd: error: " fmt , ##args); exit(1);} while (0) 16 +#define DPRINTF(fmt, ...) \
  17 +do { printf("ssi_sd: " fmt , ## __VA_ARGS__); } while (0)
  18 +#define BADF(fmt, ...) \
  19 +do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
20 #else 20 #else
21 -#define DPRINTF(fmt, args...) do {} while(0)  
22 -#define BADF(fmt, args...) \  
23 -do { fprintf(stderr, "ssi_sd: error: " fmt , ##args);} while (0) 21 +#define DPRINTF(fmt, ...) do {} while(0)
  22 +#define BADF(fmt, ...) \
  23 +do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__);} while (0)
24 #endif 24 #endif
25 25
26 typedef enum { 26 typedef enum {
hw/stellaris_enet.c
@@ -14,14 +14,14 @@ @@ -14,14 +14,14 @@
14 //#define DEBUG_STELLARIS_ENET 1 14 //#define DEBUG_STELLARIS_ENET 1
15 15
16 #ifdef DEBUG_STELLARIS_ENET 16 #ifdef DEBUG_STELLARIS_ENET
17 -#define DPRINTF(fmt, args...) \  
18 -do { printf("stellaris_enet: " fmt , ##args); } while (0)  
19 -#define BADF(fmt, args...) \  
20 -do { fprintf(stderr, "stellaris_enet: error: " fmt , ##args); exit(1);} while (0) 17 +#define DPRINTF(fmt, ...) \
  18 +do { printf("stellaris_enet: " fmt , ## __VA_ARGS__); } while (0)
  19 +#define BADF(fmt, ...) \
  20 +do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
21 #else 21 #else
22 -#define DPRINTF(fmt, args...) do {} while(0)  
23 -#define BADF(fmt, args...) \  
24 -do { fprintf(stderr, "stellaris_enet: error: " fmt , ##args);} while (0) 22 +#define DPRINTF(fmt, ...) do {} while(0)
  23 +#define BADF(fmt, ...) \
  24 +do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__);} while (0)
25 #endif 25 #endif
26 26
27 #define SE_INT_RX 0x01 27 #define SE_INT_RX 0x01
hw/sun4c_intctl.c
@@ -28,10 +28,10 @@ @@ -28,10 +28,10 @@
28 //#define DEBUG_IRQ 28 //#define DEBUG_IRQ
29 29
30 #ifdef DEBUG_IRQ 30 #ifdef DEBUG_IRQ
31 -#define DPRINTF(fmt, args...) \  
32 -do { printf("IRQ: " fmt , ##args); } while (0) 31 +#define DPRINTF(fmt, ...) \
  32 + do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0)
33 #else 33 #else
34 -#define DPRINTF(fmt, args...) 34 +#define DPRINTF(fmt, ...)
35 #endif 35 #endif
36 36
37 /* 37 /*
hw/sun4m.c
@@ -68,10 +68,10 @@ @@ -68,10 +68,10 @@
68 */ 68 */
69 69
70 #ifdef DEBUG_IRQ 70 #ifdef DEBUG_IRQ
71 -#define DPRINTF(fmt, args...) \  
72 - do { printf("CPUIRQ: " fmt , ##args); } while (0) 71 +#define DPRINTF(fmt, ...) \
  72 + do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
73 #else 73 #else
74 -#define DPRINTF(fmt, args...) 74 +#define DPRINTF(fmt, ...)
75 #endif 75 #endif
76 76
77 #define KERNEL_LOAD_ADDR 0x00004000 77 #define KERNEL_LOAD_ADDR 0x00004000
hw/sun4u.c
@@ -36,10 +36,10 @@ @@ -36,10 +36,10 @@
36 //#define DEBUG_IRQ 36 //#define DEBUG_IRQ
37 37
38 #ifdef DEBUG_IRQ 38 #ifdef DEBUG_IRQ
39 -#define DPRINTF(fmt, args...) \  
40 - do { printf("CPUIRQ: " fmt , ##args); } while (0) 39 +#define DPRINTF(fmt, ...) \
  40 + do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
41 #else 41 #else
42 -#define DPRINTF(fmt, args...) 42 +#define DPRINTF(fmt, ...)
43 #endif 43 #endif
44 44
45 #define KERNEL_LOAD_ADDR 0x00404000 45 #define KERNEL_LOAD_ADDR 0x00404000
hw/unin_pci.c
@@ -29,10 +29,10 @@ @@ -29,10 +29,10 @@
29 //#define DEBUG_UNIN 29 //#define DEBUG_UNIN
30 30
31 #ifdef DEBUG_UNIN 31 #ifdef DEBUG_UNIN
32 -#define UNIN_DPRINTF(fmt, args...) \  
33 -do { printf("UNIN: " fmt , ##args); } while (0) 32 +#define UNIN_DPRINTF(fmt, ...) \
  33 + do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0)
34 #else 34 #else
35 -#define UNIN_DPRINTF(fmt, args...) 35 +#define UNIN_DPRINTF(fmt, ...)
36 #endif 36 #endif
37 37
38 typedef target_phys_addr_t pci_addr_t; 38 typedef target_phys_addr_t pci_addr_t;
hw/usb-msd.c
@@ -16,10 +16,10 @@ @@ -16,10 +16,10 @@
16 //#define DEBUG_MSD 16 //#define DEBUG_MSD
17 17
18 #ifdef DEBUG_MSD 18 #ifdef DEBUG_MSD
19 -#define DPRINTF(fmt, args...) \  
20 -do { printf("usb-msd: " fmt , ##args); } while (0) 19 +#define DPRINTF(fmt, ...) \
  20 +do { printf("usb-msd: " fmt , ## __VA_ARGS__); } while (0)
21 #else 21 #else
22 -#define DPRINTF(fmt, args...) do {} while(0) 22 +#define DPRINTF(fmt, ...) do {} while(0)
23 #endif 23 #endif
24 24
25 /* USB requests. */ 25 /* USB requests. */
hw/usb-serial.c
@@ -15,10 +15,10 @@ @@ -15,10 +15,10 @@
15 //#define DEBUG_Serial 15 //#define DEBUG_Serial
16 16
17 #ifdef DEBUG_Serial 17 #ifdef DEBUG_Serial
18 -#define DPRINTF(fmt, args...) \  
19 -do { printf("usb-serial: " fmt , ##args); } while (0) 18 +#define DPRINTF(fmt, ...) \
  19 +do { printf("usb-serial: " fmt , ## __VA_ARGS__); } while (0)
20 #else 20 #else
21 -#define DPRINTF(fmt, args...) do {} while(0) 21 +#define DPRINTF(fmt, ...) do {} while(0)
22 #endif 22 #endif
23 23
24 #define RECV_BUF 384 24 #define RECV_BUF 384
linux-user/flatload.c
@@ -47,9 +47,9 @@ @@ -47,9 +47,9 @@
47 //#define DEBUG 47 //#define DEBUG
48 48
49 #ifdef DEBUG 49 #ifdef DEBUG
50 -#define DBG_FLT(a...) printf(a) 50 +#define DBG_FLT(...) printf(__VA_ARGS__)
51 #else 51 #else
52 -#define DBG_FLT(a...) 52 +#define DBG_FLT(...)
53 #endif 53 #endif
54 54
55 #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) 55 #define flat_reloc_valid(reloc, size) ((reloc) <= (size))
linux-user/main.c
@@ -1080,12 +1080,12 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val) @@ -1080,12 +1080,12 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val)
1080 return -1; 1080 return -1;
1081 } 1081 }
1082 1082
1083 -#define EXCP_DUMP(env, fmt, args...) \  
1084 -do { \  
1085 - fprintf(stderr, fmt , ##args); \  
1086 - cpu_dump_state(env, stderr, fprintf, 0); \  
1087 - qemu_log(fmt, ##args); \  
1088 - log_cpu_state(env, 0); \ 1083 +#define EXCP_DUMP(env, fmt, ...) \
  1084 +do { \
  1085 + fprintf(stderr, fmt , ## __VA_ARGS__); \
  1086 + cpu_dump_state(env, stderr, fprintf, 0); \
  1087 + qemu_log(fmt, ## __VA_ARGS__); \
  1088 + log_cpu_state(env, 0); \
1089 } while (0) 1089 } while (0)
1090 1090
1091 void cpu_loop(CPUPPCState *env) 1091 void cpu_loop(CPUPPCState *env)
linux-user/syscall.c
@@ -2563,7 +2563,7 @@ static abi_long do_ipc(unsigned int call, int first, @@ -2563,7 +2563,7 @@ static abi_long do_ipc(unsigned int call, int first,
2563 /* kernel structure types definitions */ 2563 /* kernel structure types definitions */
2564 #define IFNAMSIZ 16 2564 #define IFNAMSIZ 16
2565 2565
2566 -#define STRUCT(name, list...) STRUCT_ ## name, 2566 +#define STRUCT(name, ...) STRUCT_ ## name,
2567 #define STRUCT_SPECIAL(name) STRUCT_ ## name, 2567 #define STRUCT_SPECIAL(name) STRUCT_ ## name,
2568 enum { 2568 enum {
2569 #include "syscall_types.h" 2569 #include "syscall_types.h"
@@ -2571,7 +2571,7 @@ enum { @@ -2571,7 +2571,7 @@ enum {
2571 #undef STRUCT 2571 #undef STRUCT
2572 #undef STRUCT_SPECIAL 2572 #undef STRUCT_SPECIAL
2573 2573
2574 -#define STRUCT(name, list...) static const argtype struct_ ## name ## _def[] = { list, TYPE_NULL }; 2574 +#define STRUCT(name, ...) static const argtype struct_ ## name ## _def[] = { __VA_ARGS__, TYPE_NULL };
2575 #define STRUCT_SPECIAL(name) 2575 #define STRUCT_SPECIAL(name)
2576 #include "syscall_types.h" 2576 #include "syscall_types.h"
2577 #undef STRUCT 2577 #undef STRUCT
@@ -2592,8 +2592,8 @@ typedef struct IOCTLEntry { @@ -2592,8 +2592,8 @@ typedef struct IOCTLEntry {
2592 #define MAX_STRUCT_SIZE 4096 2592 #define MAX_STRUCT_SIZE 4096
2593 2593
2594 static IOCTLEntry ioctl_entries[] = { 2594 static IOCTLEntry ioctl_entries[] = {
2595 -#define IOCTL(cmd, access, types...) \  
2596 - { TARGET_ ## cmd, cmd, #cmd, access, { types } }, 2595 +#define IOCTL(cmd, access, ...) \
  2596 + { TARGET_ ## cmd, cmd, #cmd, access, { __VA_ARGS__ } },
2597 #include "ioctls.h" 2597 #include "ioctls.h"
2598 { 0, 0, }, 2598 { 0, 0, },
2599 }; 2599 };
@@ -3497,7 +3497,7 @@ void syscall_init(void) @@ -3497,7 +3497,7 @@ void syscall_init(void)
3497 int size; 3497 int size;
3498 int i; 3498 int i;
3499 3499
3500 -#define STRUCT(name, list...) thunk_register_struct(STRUCT_ ## name, #name, struct_ ## name ## _def); 3500 +#define STRUCT(name, ...) thunk_register_struct(STRUCT_ ## name, #name, struct_ ## name ## _def);
3501 #define STRUCT_SPECIAL(name) thunk_register_struct_direct(STRUCT_ ## name, #name, &struct_ ## name ## _def); 3501 #define STRUCT_SPECIAL(name) thunk_register_struct_direct(STRUCT_ ## name, #name, &struct_ ## name ## _def);
3502 #include "syscall_types.h" 3502 #include "syscall_types.h"
3503 #undef STRUCT 3503 #undef STRUCT
slirp/bootp.c
@@ -43,10 +43,10 @@ const char *bootp_filename; @@ -43,10 +43,10 @@ const char *bootp_filename;
43 static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE }; 43 static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE };
44 44
45 #ifdef DEBUG 45 #ifdef DEBUG
46 -#define dprintf(fmt, args...) \  
47 -if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## args); fflush(dfd); } 46 +#define dprintf(fmt, ...) \
  47 +if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## __VA_ARGS__); fflush(dfd); }
48 #else 48 #else
49 -#define dprintf(fmt, args...) 49 +#define dprintf(fmt, ...)
50 #endif 50 #endif
51 51
52 static BOOTPClient *get_new_addr(struct in_addr *paddr) 52 static BOOTPClient *get_new_addr(struct in_addr *paddr)
target-i386/ops_sse.h
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 */ 20 */
21 #if SHIFT == 0 21 #if SHIFT == 0
22 #define Reg MMXReg 22 #define Reg MMXReg
23 -#define XMM_ONLY(x...) 23 +#define XMM_ONLY(...)
24 #define B(n) MMX_B(n) 24 #define B(n) MMX_B(n)
25 #define W(n) MMX_W(n) 25 #define W(n) MMX_W(n)
26 #define L(n) MMX_L(n) 26 #define L(n) MMX_L(n)
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
28 #define SUFFIX _mmx 28 #define SUFFIX _mmx
29 #else 29 #else
30 #define Reg XMMReg 30 #define Reg XMMReg
31 -#define XMM_ONLY(x...) x 31 +#define XMM_ONLY(...) __VA_ARGS__
32 #define B(n) XMM_B(n) 32 #define B(n) XMM_B(n)
33 #define W(n) XMM_W(n) 33 #define W(n) XMM_W(n)
34 #define L(n) XMM_L(n) 34 #define L(n) XMM_L(n)
target-i386/translate.c
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 42
43 #ifdef TARGET_X86_64 43 #ifdef TARGET_X86_64
44 #define X86_64_ONLY(x) x 44 #define X86_64_ONLY(x) x
45 -#define X86_64_DEF(x...) x 45 +#define X86_64_DEF(...) __VA_ARGS__
46 #define CODE64(s) ((s)->code64) 46 #define CODE64(s) ((s)->code64)
47 #define REX_X(s) ((s)->rex_x) 47 #define REX_X(s) ((s)->rex_x)
48 #define REX_B(s) ((s)->rex_b) 48 #define REX_B(s) ((s)->rex_b)
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 #endif 52 #endif
53 #else 53 #else
54 #define X86_64_ONLY(x) NULL 54 #define X86_64_ONLY(x) NULL
55 -#define X86_64_DEF(x...) 55 +#define X86_64_DEF(...)
56 #define CODE64(s) 0 56 #define CODE64(s) 0
57 #define REX_X(s) 0 57 #define REX_X(s) 0
58 #define REX_B(s) 0 58 #define REX_B(s) 0
target-mips/translate.c
@@ -501,13 +501,13 @@ static const char *fregnames[] = @@ -501,13 +501,13 @@ static const char *fregnames[] =
501 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", }; 501 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", };
502 502
503 #ifdef MIPS_DEBUG_DISAS 503 #ifdef MIPS_DEBUG_DISAS
504 -#define MIPS_DEBUG(fmt, args...) \ 504 +#define MIPS_DEBUG(fmt, ...) \
505 qemu_log_mask(CPU_LOG_TB_IN_ASM, \ 505 qemu_log_mask(CPU_LOG_TB_IN_ASM, \
506 TARGET_FMT_lx ": %08x " fmt "\n", \ 506 TARGET_FMT_lx ": %08x " fmt "\n", \
507 - ctx->pc, ctx->opcode , ##args) 507 + ctx->pc, ctx->opcode , ## __VA_ARGS__)
508 #define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__) 508 #define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
509 #else 509 #else
510 -#define MIPS_DEBUG(fmt, args...) do { } while(0) 510 +#define MIPS_DEBUG(fmt, ...) do { } while(0)
511 #define LOG_DISAS(...) do { } while (0) 511 #define LOG_DISAS(...) do { } while (0)
512 #endif 512 #endif
513 513
target-sparc/op_helper.c
@@ -13,22 +13,22 @@ @@ -13,22 +13,22 @@
13 //#define DEBUG_PCALL 13 //#define DEBUG_PCALL
14 14
15 #ifdef DEBUG_MMU 15 #ifdef DEBUG_MMU
16 -#define DPRINTF_MMU(fmt, args...) \  
17 -do { printf("MMU: " fmt , ##args); } while (0) 16 +#define DPRINTF_MMU(fmt, ...) \
  17 + do { printf("MMU: " fmt , ## __VA_ARGS__); } while (0)
18 #else 18 #else
19 -#define DPRINTF_MMU(fmt, args...) do {} while (0) 19 +#define DPRINTF_MMU(fmt, ...) do {} while (0)
20 #endif 20 #endif
21 21
22 #ifdef DEBUG_MXCC 22 #ifdef DEBUG_MXCC
23 -#define DPRINTF_MXCC(fmt, args...) \  
24 -do { printf("MXCC: " fmt , ##args); } while (0) 23 +#define DPRINTF_MXCC(fmt, ...) \
  24 + do { printf("MXCC: " fmt , ## __VA_ARGS__); } while (0)
25 #else 25 #else
26 -#define DPRINTF_MXCC(fmt, args...) do {} while (0) 26 +#define DPRINTF_MXCC(fmt, ...) do {} while (0)
27 #endif 27 #endif
28 28
29 #ifdef DEBUG_ASI 29 #ifdef DEBUG_ASI
30 -#define DPRINTF_ASI(fmt, args...) \  
31 -do { printf("ASI: " fmt , ##args); } while (0) 30 +#define DPRINTF_ASI(fmt, ...) \
  31 + do { printf("ASI: " fmt , ## __VA_ARGS__); } while (0)
32 #endif 32 #endif
33 33
34 #ifdef TARGET_SPARC64 34 #ifdef TARGET_SPARC64
tests/linux-test.c
@@ -65,7 +65,7 @@ int __chk_error(const char *filename, int line, int ret) @@ -65,7 +65,7 @@ int __chk_error(const char *filename, int line, int ret)
65 return ret; 65 return ret;
66 } 66 }
67 67
68 -#define error(fmt, args...) error1(__FILE__, __LINE__, fmt, ##args) 68 +#define error(fmt, ...) error1(__FILE__, __LINE__, fmt, ## __VA_ARGS__)
69 69
70 #define chk_error(ret) __chk_error(__FILE__, __LINE__, (ret)) 70 #define chk_error(ret) __chk_error(__FILE__, __LINE__, (ret))
71 71