]> git.proxmox.com Git - qemu.git/commitdiff
Replace gcc variadic macro extension with C99 version
authorBlue Swirl <blauwirbel@gmail.com>
Wed, 13 May 2009 17:53:17 +0000 (17:53 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Wed, 13 May 2009 17:53:17 +0000 (17:53 +0000)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
70 files changed:
block-raw-posix.c
darwin-user/main.c
darwin-user/syscall.c
hw/adb.c
hw/apb_pci.c
hw/arm_gic.c
hw/cs4231.c
hw/cuda.c
hw/dp8393x.c
hw/eccmemctl.c
hw/eepro100.c
hw/eeprom93xx.c
hw/escc.c
hw/esp.c
hw/fdc.c
hw/fw_cfg.c
hw/g364fb.c
hw/grackle_pci.c
hw/heathrow_pic.c
hw/iommu.c
hw/lsi53c895a.c
hw/m48t59.c
hw/mac_dbdma.c
hw/mac_nvram.c
hw/mcf_fec.c
hw/mips_malta.c
hw/openpic.c
hw/parallel.c
hw/pci_host.h
hw/pflash_cfi01.c
hw/pflash_cfi02.c
hw/pl022.c
hw/pl031.c
hw/pl061.c
hw/pl181.c
hw/ppc4xx_pci.c
hw/ppc_newworld.c
hw/ppc_prep.c
hw/ppce500_pci.c
hw/rc4030.c
hw/sbi.c
hw/scsi-disk.c
hw/scsi-generic.c
hw/sd.c
hw/sh_intc.h
hw/slavio_intctl.c
hw/slavio_misc.c
hw/slavio_timer.c
hw/sm501.c
hw/smbus.c
hw/sparc32_dma.c
hw/ssd0303.c
hw/ssd0323.c
hw/ssi-sd.c
hw/stellaris_enet.c
hw/sun4c_intctl.c
hw/sun4m.c
hw/sun4u.c
hw/unin_pci.c
hw/usb-msd.c
hw/usb-serial.c
linux-user/flatload.c
linux-user/main.c
linux-user/syscall.c
slirp/bootp.c
target-i386/ops_sse.h
target-i386/translate.c
target-mips/translate.c
target-sparc/op_helper.c
tests/linux-test.c

index 0663c0695b4054c956d5a129050614b04712a743..bcb3e0145fb186c3b2363cb21051bbe234055712 100644 (file)
 
 //#define DEBUG_BLOCK
 #if defined(DEBUG_BLOCK)
-#define DEBUG_BLOCK_PRINT(formatCstr, args...) do { if (qemu_log_enabled())    \
-    { qemu_log(formatCstr, ##args); qemu_log_flush(); } } while (0)
+#define DEBUG_BLOCK_PRINT(formatCstr, ...) do { if (qemu_log_enabled()) \
+    { qemu_log(formatCstr, ## __VA_ARGS__); qemu_log_flush(); } } while (0)
 #else
-#define DEBUG_BLOCK_PRINT(formatCstr, args...)
+#define DEBUG_BLOCK_PRINT(formatCstr, ...)
 #endif
 
 /* OS X does not have O_DSYNC */
index 51c6aa0f4d4d07f7fa510466584bdfa4151c1ff0..5e3c48db2c272cf5edc251d43ed7b8a7855fab39 100644 (file)
@@ -158,12 +158,12 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val)
     return -1;
 }
 
-#define EXCP_DUMP(env, fmt, args...)                                         \
-do {                                                                          \
-    fprintf(stderr, fmt , ##args);                                            \
-    cpu_dump_state(env, stderr, fprintf, 0);                                  \
-    qemu_log(fmt, ##args);                                                   \
-    log_cpu_state(env, 0);                                                      \
+#define EXCP_DUMP(env, fmt, ...)                                        \
+do {                                                                    \
+    fprintf(stderr, fmt , ## __VA_ARGS__);                              \
+    cpu_dump_state(env, stderr, fprintf, 0);                            \
+    qemu_log(fmt, ## __VA_ARGS__);                                      \
+    log_cpu_state(env, 0);                                              \
 } while (0)
 
 void cpu_loop(CPUPPCState *env)
index 130d33c6b842f78f079b10440a169f1cadd274a5..0c68787773f46b14a3929a94caffbac524698fe7 100644 (file)
@@ -627,7 +627,7 @@ static inline void byteswap_winsize(struct winsize *w)
     tswap16s(&w->ws_ypixel);
 }
 
-#define STRUCT(name, list...) STRUCT_ ## name,
+#define STRUCT(name, ...) STRUCT_ ## name,
 #define STRUCT_SPECIAL(name) STRUCT_ ## name,
 enum {
 #include "ioctls_types.h"
@@ -635,7 +635,7 @@ enum {
 #undef STRUCT
 #undef STRUCT_SPECIAL
 
-#define STRUCT(name, list...) const argtype struct_ ## name ## _def[] = { list, TYPE_NULL };
+#define STRUCT(name, ...) const argtype struct_ ## name ## _def[] = {  __VA_ARGS__, TYPE_NULL };
 #define STRUCT_SPECIAL(name)
 #include "ioctls_types.h"
 #undef STRUCT
@@ -656,8 +656,8 @@ typedef struct IOCTLEntry {
 #define MAX_STRUCT_SIZE 4096
 
 static IOCTLEntry ioctl_entries[] = {
-#define IOCTL(cmd, access, types...) \
-    { cmd, cmd, #cmd, access, { types } },
+#define IOCTL(cmd, access,  ...)                        \
+    { cmd, cmd, #cmd, access, {  __VA_ARGS__ } },
 #include "ioctls.h"
     { 0, 0, },
 };
@@ -898,10 +898,10 @@ typedef long (*syscall_function_t)(void *cpu_env, int num);
 #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); }
 #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); }
 #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); }
-#define WRAPPER_CALL_DIRECT(function, nargs, args...) WRAPPER_CALL_DIRECT_##nargs(function, args)
-#define WRAPPER_CALL_NOERRNO(function, nargs, args...)  WRAPPER_CALL_DIRECT(function, nargs, args)
-#define WRAPPER_CALL_INDIRECT(function, nargs, args...)
-#define ENTRY(name, number, function, nargs, call_type, args...)  WRAPPER_##call_type(function, nargs, args)
+#define WRAPPER_CALL_DIRECT(function, nargs, ...) WRAPPER_CALL_DIRECT_##nargs(function, __VA_ARGS__)
+#define WRAPPER_CALL_NOERRNO(function, nargs, ...)  WRAPPER_CALL_DIRECT(function, nargs, __VA_ARGS__)
+#define WRAPPER_CALL_INDIRECT(function, nargs, ...)
+#define ENTRY(name, number, function, nargs, call_type, ...)  WRAPPER_##call_type(function, nargs, __VA_ARGS__)
 
 #include "syscalls.h"
 
@@ -926,7 +926,7 @@ typedef long (*syscall_function_t)(void *cpu_env, int num);
 #define ENTRY_CALL_DIRECT(name, number, function, nargs, call_type)  _ENTRY(name, number, __qemu_##function, nargs, call_type)
 #define ENTRY_CALL_NOERRNO(name, number, function, nargs, call_type) ENTRY_CALL_DIRECT(name, number, function, nargs, call_type)
 #define ENTRY_CALL_INDIRECT(name, number, function, nargs, call_type) _ENTRY(name, number, function, nargs, call_type)
-#define ENTRY(name, number, function, nargs, call_type, args...) ENTRY_##call_type(name, number, function, nargs, call_type)
+#define ENTRY(name, number, function, nargs, call_type, ...) ENTRY_##call_type(name, number, function, nargs, call_type)
 
 #define CALL_DIRECT 1
 #define CALL_INDIRECT 2
index 61a3cdf210c233874c552e95e339b92cefa6c1d2..c57aeaac4a20bb9da5cde7f26415559c4cb867d9 100644 (file)
--- a/hw/adb.c
+++ b/hw/adb.c
 //#define DEBUG_ADB
 
 #ifdef DEBUG_ADB
-#define ADB_DPRINTF(fmt, args...) \
-do { printf("ADB: " fmt , ##args); } while (0)
+#define ADB_DPRINTF(fmt, ...) \
+do { printf("ADB: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define ADB_DPRINTF(fmt, args...)
+#define ADB_DPRINTF(fmt, ...)
 #endif
 
 /* ADB commands */
index 36ecb5584b53c4ffdad611a1bf8104763db4fa5d..d6ce9f4aef51f6f8d937afc9302f1f57b65dabe5 100644 (file)
 //#define DEBUG_APB
 
 #ifdef DEBUG_APB
-#define APB_DPRINTF(fmt, args...) \
-do { printf("APB: " fmt , ##args); } while (0)
+#define APB_DPRINTF(fmt, ...) \
+do { printf("APB: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define APB_DPRINTF(fmt, args...)
+#define APB_DPRINTF(fmt, ...)
 #endif
 
 typedef target_phys_addr_t pci_addr_t;
index 2f484e191e0f505b7539860922ff4b3ac6315cce..cb774d6e20e5c0ff92530b54246388cdb8ef0c6a 100644 (file)
 //#define DEBUG_GIC
 
 #ifdef DEBUG_GIC
-#define DPRINTF(fmt, args...) \
-do { printf("arm_gic: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("arm_gic: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
+#define DPRINTF(fmt, ...) do {} while(0)
 #endif
 
 #ifdef NVIC
index 59d83e01b2ff08d5aa7bc1c067a8258a6f6c5428..22669806de1e32c7c47480ba50cada6da306b670 100644 (file)
@@ -46,10 +46,10 @@ typedef struct CSState {
 #define CS_CDC_VER 0x8a
 
 #ifdef DEBUG_CS
-#define DPRINTF(fmt, args...)                           \
-    do { printf("CS: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("CS: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
 static void cs_reset(void *opaque)
index 0956354817a397832aa49dd75694ef55c9160ead..145aa9c2adede0cec62cbd6d317857dcb48798e8 100644 (file)
--- a/hw/cuda.c
+++ b/hw/cuda.c
 //#define DEBUG_CUDA_PACKET
 
 #ifdef DEBUG_CUDA
-#define CUDA_DPRINTF(fmt, args...) \
-do { printf("CUDA: " fmt , ##args); } while (0)
+#define CUDA_DPRINTF(fmt, ...)                                  \
+    do { printf("CUDA: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define CUDA_DPRINTF(fmt, args...)
+#define CUDA_DPRINTF(fmt, ...)
 #endif
 
 /* Bits in B data register: all active low */
index 6170588e99860735aefd73db65499463dc3522b4..44184097e3207d51712376d5d1cf8c796377b47d 100644 (file)
@@ -34,8 +34,8 @@
 #endif
 
 #ifdef DEBUG_SONIC
-#define DPRINTF(fmt, args...) \
-do { printf("sonic: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("sonic: " fmt , ##  __VA_ARGS__); } while (0)
 static const char* reg_names[] = {
     "CR", "DCR", "RCR", "TCR", "IMR", "ISR", "UTDA", "CTDA",
     "TPS", "TFC", "TSA0", "TSA1", "TFS", "URDA", "CRDA", "CRBA0",
@@ -46,11 +46,11 @@ static const char* reg_names[] = {
     "0x30", "0x31", "0x32", "0x33", "0x34", "0x35", "0x36", "0x37",
     "0x38", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "DCR2" };
 #else
-#define DPRINTF(fmt, args...) do {} while (0)
+#define DPRINTF(fmt, ...) do {} while (0)
 #endif
 
-#define SONIC_ERROR(fmt, args...) \
-do { printf("sonic ERROR: %s: " fmt, __func__ , ##args); } while (0)
+#define SONIC_ERROR(fmt, ...) \
+do { printf("sonic ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
 
 #define SONIC_CR     0x00
 #define SONIC_DCR    0x01
index 28519c81f9257227d1c6e7c6ae7190334ed5824c..07f5ef76ff245bba0574d6fe5b78ceb899373539 100644 (file)
 //#define DEBUG_ECC
 
 #ifdef DEBUG_ECC
-#define DPRINTF(fmt, args...)                           \
-    do { printf("ECC: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("ECC: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
 /* There are 3 versions of this chip used in SMP sun4m systems:
index 235e598725c35aa5e9b12651a97db9bbabb4d933..7dbbca009486d95a7735f2b387327d4d869c080a 100644 (file)
@@ -60,9 +60,9 @@
 //~ #define DEBUG_EEPRO100
 
 #ifdef DEBUG_EEPRO100
-#define logout(fmt, args...) fprintf(stderr, "EE100\t%-24s" fmt, __func__, ##args)
+#define logout(fmt, ...) fprintf(stderr, "EE100\t%-24s" fmt, __func__, ## __VA_ARGS__)
 #else
-#define logout(fmt, args...) ((void)0)
+#define logout(fmt, ...) ((void)0)
 #endif
 
 /* Set flags to 0 to disable debug output. */
index ae15a7f6362df615d9ed4e4d7dd184aa8f9a0f37..e4b6b13b76731c2cb7114ff015f2f61ff2f4c53c 100644 (file)
@@ -44,9 +44,9 @@
 //~ #define DEBUG_EEPROM
 
 #ifdef DEBUG_EEPROM
-#define logout(fmt, args...) fprintf(stderr, "EEPROM\t%-24s" fmt, __func__, ##args)
+#define logout(fmt, ...) fprintf(stderr, "EEPROM\t%-24s" fmt, __func__, ## __VA_ARGS__)
 #else
-#define logout(fmt, args...) ((void)0)
+#define logout(fmt, ...) ((void)0)
 #endif
 
 #define EEPROM_INSTANCE  0
index 4c299ff6e4383db35cc6f8900cfff90bcccf2745..53808e58417a04c80689bc7d004ee41d63396b37 100644 (file)
--- a/hw/escc.c
+++ b/hw/escc.c
  */
 
 #ifdef DEBUG_SERIAL
-#define SER_DPRINTF(fmt, args...) \
-do { printf("SER: " fmt , ##args); } while (0)
+#define SER_DPRINTF(fmt, ...)                                   \
+    do { printf("SER: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define SER_DPRINTF(fmt, args...)
+#define SER_DPRINTF(fmt, ...)
 #endif
 #ifdef DEBUG_KBD
-#define KBD_DPRINTF(fmt, args...) \
-do { printf("KBD: " fmt , ##args); } while (0)
+#define KBD_DPRINTF(fmt, ...)                                   \
+    do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define KBD_DPRINTF(fmt, args...)
+#define KBD_DPRINTF(fmt, ...)
 #endif
 #ifdef DEBUG_MOUSE
-#define MS_DPRINTF(fmt, args...) \
-do { printf("MSC: " fmt , ##args); } while (0)
+#define MS_DPRINTF(fmt, ...)                                    \
+    do { printf("MSC: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define MS_DPRINTF(fmt, args...)
+#define MS_DPRINTF(fmt, ...)
 #endif
 
 typedef enum {
index aa1a76eabbfbfc64373a03247aeb91313bdf4297..17b8f9635b2d4c816d87705a0d78460b3d9e7025 100644 (file)
--- a/hw/esp.c
+++ b/hw/esp.c
  */
 
 #ifdef DEBUG_ESP
-#define DPRINTF(fmt, args...) \
-do { printf("ESP: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("ESP: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while (0)
+#define DPRINTF(fmt, ...) do {} while (0)
 #endif
 
-#define ESP_ERROR(fmt, args...) \
-do { printf("ESP ERROR: %s: " fmt, __func__ , ##args); } while (0)
+#define ESP_ERROR(fmt, ...)                                             \
+    do { printf("ESP ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
 
 #define ESP_REGS 16
 #define TI_BUFSZ 16
index b00a4ecec34168dd44345b07b26bf5937226242c..f4a4be0177465ae429c8f6d68930bcb71547b0a5 100644 (file)
--- a/hw/fdc.c
+++ b/hw/fdc.c
 //#define DEBUG_FLOPPY
 
 #ifdef DEBUG_FLOPPY
-#define FLOPPY_DPRINTF(fmt, args...) \
-do { printf("FLOPPY: " fmt , ##args); } while (0)
+#define FLOPPY_DPRINTF(fmt, ...)                                \
+    do { printf("FLOPPY: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define FLOPPY_DPRINTF(fmt, args...)
+#define FLOPPY_DPRINTF(fmt, ...)
 #endif
 
-#define FLOPPY_ERROR(fmt, args...) \
-do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ##args); } while (0)
+#define FLOPPY_ERROR(fmt, ...)                                          \
+    do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
 
 /********************************************************/
 /* Floppy drive emulation                               */
index e1b19d72ebaad99430f58cac87388b76555fc2b3..39bd9559050b75b7b35cd34f490a73845a8b6acf 100644 (file)
 //#define DEBUG_FW_CFG
 
 #ifdef DEBUG_FW_CFG
-#define FW_CFG_DPRINTF(fmt, args...)                     \
-    do { printf("FW_CFG: " fmt , ##args); } while (0)
+#define FW_CFG_DPRINTF(fmt, ...)                        \
+    do { printf("FW_CFG: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define FW_CFG_DPRINTF(fmt, args...)
+#define FW_CFG_DPRINTF(fmt, ...)
 #endif
 
 #define FW_CFG_SIZE 2
index 6d37ca128e9594823add6df896f97ca6dddce464..54c201c853dc96c2b4926dcdf732a7cf19d97262 100644 (file)
 //#define DEBUG_G364
 
 #ifdef DEBUG_G364
-#define DPRINTF(fmt, args...) \
-do { printf("g364: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("g364: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while (0)
+#define DPRINTF(fmt, ...) do {} while (0)
 #endif
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "g364 ERROR: " fmt , ##args);} while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "g364 ERROR: " fmt , ## __VA_ARGS__);} while (0)
 
 typedef struct G364State {
     /* hardware */
index 61606b22f2d93cbe8d0b4a2609c060d9ddf1eff6..e9769cd7f40fa28984bbb5486e68c27e7eac2634 100644 (file)
 //#define DEBUG_GRACKLE
 
 #ifdef DEBUG_GRACKLE
-#define GRACKLE_DPRINTF(fmt, args...) \
-do { printf("GRACKLE: " fmt , ##args); } while (0)
+#define GRACKLE_DPRINTF(fmt, ...)                               \
+    do { printf("GRACKLE: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define GRACKLE_DPRINTF(fmt, args...)
+#define GRACKLE_DPRINTF(fmt, ...)
 #endif
 
 typedef target_phys_addr_t pci_addr_t;
index f0518bb0b988a8a72f4521467b8cdee4f458b6cf..9a67ec0dace6f68a0f58ddfb81a8a32a2f3aef28 100644 (file)
 //#define DEBUG_PIC
 
 #ifdef DEBUG_PIC
-#define PIC_DPRINTF(fmt, args...) \
-do { printf("PIC: " fmt , ##args); } while (0)
+#define PIC_DPRINTF(fmt, ...)                                   \
+    do { printf("PIC: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define PIC_DPRINTF(fmt, args...)
+#define PIC_DPRINTF(fmt, ...)
 #endif
 
 typedef struct HeathrowPIC {
index cde5f1f0bab65256a1aebea735c81e062e228e65..d52acd7a25cc57067d0bbd60c2d30c0e7779bb53 100644 (file)
 //#define DEBUG_IOMMU
 
 #ifdef DEBUG_IOMMU
-#define DPRINTF(fmt, args...) \
-do { printf("IOMMU: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("IOMMU: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
 #define IOMMU_NREGS         (4*4096/4)
index 1f4f8b7ef7ea865bb0213102d3cb82cbdb06a2a6..f4e57aedb5f2a7f7c788d779d8075c55aa74b272 100644 (file)
 //#define DEBUG_LSI_REG
 
 #ifdef DEBUG_LSI
-#define DPRINTF(fmt, args...) \
-do { printf("lsi_scsi: " fmt , ##args); } while (0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "lsi_scsi: error: " fmt , ##args); exit(1);} while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("lsi_scsi: " fmt , ## __VA_ARGS__); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "lsi_scsi: error: " fmt , ##args);} while (0)
+#define DPRINTF(fmt, ...) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__);} while (0)
 #endif
 
 #define LSI_SCNTL0_TRG    0x01
index 0cfdab39f2107829addbad75bba6b5f566cf5b5a..c6829beb3ba9506b27b1d7b96b0871e14b707d49 100644 (file)
@@ -30,9 +30,9 @@
 //#define DEBUG_NVRAM
 
 #if defined(DEBUG_NVRAM)
-#define NVRAM_PRINTF(fmt, args...) do { printf(fmt , ##args); } while (0)
+#define NVRAM_PRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0)
 #else
-#define NVRAM_PRINTF(fmt, args...) do { } while (0)
+#define NVRAM_PRINTF(fmt, ...) do { } while (0)
 #endif
 
 /*
index e863980d9c2c8c66f38e4e81fbfabf45f618191c..a94cd092c0a1b1d681f093fa4db162fad4e9cafd 100644 (file)
 //#define DEBUG_DBDMA
 
 #ifdef DEBUG_DBDMA
-#define DBDMA_DPRINTF(fmt, args...) \
-do { printf("DBDMA: " fmt , ##args); } while (0)
+#define DBDMA_DPRINTF(fmt, ...)                                 \
+    do { printf("DBDMA: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DBDMA_DPRINTF(fmt, args...)
+#define DBDMA_DPRINTF(fmt, ...)
 #endif
 
 /*
index ae4d4bbf463df58811af5bd3322b724ca7d284c9..36648d1872881e1517f173683b636e8ca29587c9 100644 (file)
 //#define DEBUG_NVR
 
 #ifdef DEBUG_NVR
-#define NVR_DPRINTF(fmt, args...) \
-do { printf("NVR: " fmt , ##args); } while (0)
+#define NVR_DPRINTF(fmt, ...)                                   \
+    do { printf("NVR: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define NVR_DPRINTF(fmt, args...)
+#define NVR_DPRINTF(fmt, ...)
 #endif
 
 struct MacIONVRAMState {
index 81f179bf6506b347c8bc45b9b5e5003825e69415..6c0acc5789d480e8e1ee1620cd6068b8d1ff4aea 100644 (file)
 //#define DEBUG_FEC 1
 
 #ifdef DEBUG_FEC
-#define DPRINTF(fmt, args...) \
-do { printf("mcf_fec: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("mcf_fec: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
+#define DPRINTF(fmt, ...) do {} while(0)
 #endif
 
 #define FEC_MAX_FRAME_SIZE 2032
index fd81753d2bad6dc7a465da23389fd4288a37a541..9710adc24e30a289f07f0910561b9d1b00ab35aa 100644 (file)
@@ -114,9 +114,9 @@ static void malta_fpga_update_display(void *opaque)
 //~ #define DEBUG
 
 #if defined(DEBUG)
-#  define logout(fmt, args...) fprintf(stderr, "MALTA\t%-24s" fmt, __func__, ##args)
+#  define logout(fmt, ...) fprintf(stderr, "MALTA\t%-24s" fmt, __func__, ## __VA_ARGS__)
 #else
-#  define logout(fmt, args...) ((void)0)
+#  define logout(fmt, ...) ((void)0)
 #endif
 
 struct _eeprom24c0x_t {
index 53747c4580ed1bbe491eb5b74fe3bc795cd067d1..561c609e3f700acbe3f656822c13af232271f812 100644 (file)
@@ -40,9 +40,9 @@
 //#define DEBUG_OPENPIC
 
 #ifdef DEBUG_OPENPIC
-#define DPRINTF(fmt, args...) do { printf(fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) do { printf(fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do { } while (0)
+#define DPRINTF(fmt, ...) do { } while (0)
 #endif
 
 #define USE_MPCxxx /* Intel model is broken, for now */
index 0abd0a2c085398627542b69f75b766a09cad95eb..dd2eedab7909eb83557d485f914b4dbefa61eeaf 100644 (file)
@@ -30,9 +30,9 @@
 //#define DEBUG_PARALLEL
 
 #ifdef DEBUG_PARALLEL
-#define pdebug(fmt, arg...) printf("pp: " fmt, ##arg)
+#define pdebug(fmt, ...) printf("pp: " fmt, ## __VA_ARGS__)
 #else
-#define pdebug(fmt, arg...) ((void)0)
+#define pdebug(fmt, ...) ((void)0)
 #endif
 
 #define PARA_REG_DATA 0
index c4f42a40e10dd9f2df2c2df246dae5f2fe946b27..757b0e28382756d8243214d75433ab52d9713258 100644 (file)
 //#define DEBUG_PCI
 
 #ifdef DEBUG_PCI
-#define PCI_DPRINTF(fmt, args...) \
-do { printf("pci_host_data: " fmt , ##args); } while (0)
+#define PCI_DPRINTF(fmt, ...) \
+do { printf("pci_host_data: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define PCI_DPRINTF(fmt, args...)
+#define PCI_DPRINTF(fmt, ...)
 #endif
 
 typedef struct {
index 1c433aa859ecf4022d1a40bc90b6b9e77f842d02..d696560ac628180328bf63afa794b5de5a918002 100644 (file)
 #include "block.h"
 #include "qemu-timer.h"
 
-#define PFLASH_BUG(fmt, args...) \
+#define PFLASH_BUG(fmt, ...) \
 do { \
-    printf("PFLASH: Possible BUG - " fmt, ##args); \
+    printf("PFLASH: Possible BUG - " fmt, ## __VA_ARGS__); \
     exit(1); \
 } while(0)
 
 /* #define PFLASH_DEBUG */
 #ifdef PFLASH_DEBUG
-#define DPRINTF(fmt, args...)                      \
+#define DPRINTF(fmt, ...)                          \
 do {                                               \
-        printf("PFLASH: " fmt , ##args);           \
+    printf("PFLASH: " fmt , ## __VA_ARGS__);       \
 } while (0)
 #else
-#define DPRINTF(fmt, args...) do { } while (0)
+#define DPRINTF(fmt, ...) do { } while (0)
 #endif
 
 struct pflash_t {
index 799398ca1aa7ec9eddfef9444d8357851722f935..60edbf5d2a5a020eb259c4595c13be09c9ba4246 100644 (file)
 
 //#define PFLASH_DEBUG
 #ifdef PFLASH_DEBUG
-#define DPRINTF(fmt, args...)                      \
+#define DPRINTF(fmt, ...)                          \
 do {                                               \
-        printf("PFLASH: " fmt , ##args);           \
+    printf("PFLASH: " fmt , ## __VA_ARGS__);       \
 } while (0)
 #else
-#define DPRINTF(fmt, args...) do { } while (0)
+#define DPRINTF(fmt, ...) do { } while (0)
 #endif
 
 struct pflash_t {
index 3027bcf7e3d17f0f04afbd9b828b05652c131590..4f0ff87da8116347636077b83df0013b9a14b56d 100644 (file)
 //#define DEBUG_PL022 1
 
 #ifdef DEBUG_PL022
-#define DPRINTF(fmt, args...) \
-do { printf("pl022: " fmt , ##args); } while (0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "pl022: error: " fmt , ##args); exit(1);} while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("pl022: " fmt , ## __VA_ARGS__); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "pl022: error: " fmt , ##args);} while (0)
+#define DPRINTF(fmt, ...) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0)
 #endif
 
 #define PL022_CR1_LBM 0x01
index bb47507847f46dfac1f126de1dabee69472e3e46..6b27180bde2829e621406f7ffb7c972da3b10e43 100644 (file)
 //#define DEBUG_PL031
 
 #ifdef DEBUG_PL031
-#define DPRINTF(fmt, args...) \
-do { printf("pl031: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("pl031: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
+#define DPRINTF(fmt, ...) do {} while(0)
 #endif
 
 #define RTC_DR      0x00    /* Data read register */
index 71141adb12a5722ce04c9e6027cb5fcb8dc36699..1263992bb8913bafc3127ca579d743d61c1cd4ce 100644 (file)
 //#define DEBUG_PL061 1
 
 #ifdef DEBUG_PL061
-#define DPRINTF(fmt, args...) \
-do { printf("pl061: " fmt , ##args); } while (0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "pl061: error: " fmt , ##args); exit(1);} while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("pl061: " fmt , ## __VA_ARGS__); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "pl061: error: " fmt , ##args);} while (0)
+#define DPRINTF(fmt, ...) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__);} while (0)
 #endif
 
 static const uint8_t pl061_id[12] =
index b6a86d3a629512c13863441aea65bbe6bfae9572..ab4e978ae37a8380228b81ee7510ec6327beaa82 100644 (file)
 //#define DEBUG_PL181 1
 
 #ifdef DEBUG_PL181
-#define DPRINTF(fmt, args...) \
-do { printf("pl181: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("pl181: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
+#define DPRINTF(fmt, ...) do {} while(0)
 #endif
 
 #define PL181_FIFO_LEN 16
index 2e675083dc59e9f3ba0dbe0dbfe9b521448a7f86..5198bbb6115d09c77a8c33037efad5a37af447bf 100644 (file)
@@ -33,7 +33,7 @@ typedef target_phys_addr_t pci_addr_t;
 #ifdef DEBUG
 #define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif /* DEBUG */
 
 struct PCIMasterMap {
index 760249ea2a8ad2de1f4b971b1f43a3aff81863d1..29faa06318a180ba569872182746d87bd0107cd7 100644 (file)
 //#define DEBUG_UNIN
 
 #ifdef DEBUG_UNIN
-#define UNIN_DPRINTF(fmt, args...) \
-do { printf("UNIN: " fmt , ##args); } while (0)
+#define UNIN_DPRINTF(fmt, ...)                                  \
+    do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define UNIN_DPRINTF(fmt, args...)
+#define UNIN_DPRINTF(fmt, ...)
 #endif
 
 /* UniN device */
index 9584d91681223a0dcae578dc80fd0b119d92f703..b98c6c2002b29f70306d02db911890e35fe2adad 100644 (file)
 #endif
 
 #if defined (HARD_DEBUG_PPC_IO)
-#define PPC_IO_DPRINTF(fmt, args...)                     \
+#define PPC_IO_DPRINTF(fmt, ...)                         \
 do {                                                     \
     if (qemu_loglevel_mask(CPU_LOG_IOPORT)) {            \
-        qemu_log("%s: " fmt, __func__ , ##args); \
+        qemu_log("%s: " fmt, __func__ , ## __VA_ARGS__); \
     } else {                                             \
-        printf("%s : " fmt, __func__ , ##args);          \
+        printf("%s : " fmt, __func__ , ## __VA_ARGS__);  \
     }                                                    \
 } while (0)
 #elif defined (DEBUG_PPC_IO)
-#define PPC_IO_DPRINTF(fmt, args...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__)
+#define PPC_IO_DPRINTF(fmt, ...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__)
 #else
-#define PPC_IO_DPRINTF(fmt, args...) do { } while (0)
+#define PPC_IO_DPRINTF(fmt, ...) do { } while (0)
 #endif
 
 /* Constants for devices init */
index 547218fabc152db9a93fa41013078d64cb7f178b..9eed890d4445f853482c545c43e9b41c53c96ec9 100644 (file)
@@ -24,9 +24,9 @@ typedef target_phys_addr_t pci_addr_t;
 #include "qemu-log.h"
 
 #ifdef DEBUG_PCI
-#define pci_debug(fmt, arg...) fprintf(stderr, fmt, ##arg)
+#define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
 #else
-#define pci_debug(fmt, arg...)
+#define pci_debug(fmt, ...)
 #endif
 
 #define PCIE500_CFGADDR       0x0
index 2f9bb0e43c93fca9db4144b0b06dde9fca79f75b..7fe84ff49663807c53f2626ee2cf6d4468d766b5 100644 (file)
 //#define DEBUG_RC4030_DMA
 
 #ifdef DEBUG_RC4030
-#define DPRINTF(fmt, args...) \
-do { printf("rc4030: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("rc4030: " fmt , ## __VA_ARGS__); } while (0)
 static const char* irq_names[] = { "parallel", "floppy", "sound", "video",
             "network", "scsi", "keyboard", "mouse", "serial0", "serial1" };
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
-#define RC4030_ERROR(fmt, args...) \
-do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ##args); } while (0)
+#define RC4030_ERROR(fmt, ...) \
+do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
 
 /********************************************************/
 /* rc4030 emulation                                     */
index 9c41f536578df39717b9bfb3cb6f36006a562fde..1993eec5c756fe6f6047ddd312dc60e2cb6f97d2 100644 (file)
--- a/hw/sbi.c
+++ b/hw/sbi.c
 //#define DEBUG_IRQ
 
 #ifdef DEBUG_IRQ
-#define DPRINTF(fmt, args...) \
-do { printf("IRQ: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
 #define MAX_CPUS 16
index 8f1afab51a9292042745e16f2c75fa58a185b4e2..a0485dbeb858ec088f0d0fa2e054fd6117bd433d 100644 (file)
 //#define DEBUG_SCSI
 
 #ifdef DEBUG_SCSI
-#define DPRINTF(fmt, args...) \
-do { printf("scsi-disk: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
+#define DPRINTF(fmt, ...) do {} while(0)
 #endif
 
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "scsi-disk: " fmt , ##args); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
 
 #include "qemu-common.h"
 #include "block.h"
index f4c615b626379ac43436bde315c1cf2373b8bbc5..c827c04a198c9f2c99606ecd7d9748262c377b97 100644 (file)
@@ -28,14 +28,14 @@ SCSIDevice *scsi_generic_init(BlockDriverState *bdrv, int tcq,
 //#define DEBUG_SCSI
 
 #ifdef DEBUG_SCSI
-#define DPRINTF(fmt, args...) \
-do { printf("scsi-generic: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
+#define DPRINTF(fmt, ...) do {} while(0)
 #endif
 
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "scsi-generic: " fmt , ##args); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
 
 #include <stdio.h>
 #include <sys/types.h>
diff --git a/hw/sd.c b/hw/sd.c
index fc925301351c8466297e6663110120b11c9bf2b5..9888547436cdc8d24079140bf8be1694873f54e7 100644 (file)
--- a/hw/sd.c
+++ b/hw/sd.c
 //#define DEBUG_SD 1
 
 #ifdef DEBUG_SD
-#define DPRINTF(fmt, args...) \
-do { fprintf(stderr, "SD: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { fprintf(stderr, "SD: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
+#define DPRINTF(fmt, ...) do {} while(0)
 #endif
 
 typedef enum {
index a9750ae9b19137d8cf47b3dcf50acf88e38fd7cd..c117d6fb8c0bf6fe8468555233a46b9599c7c77d 100644 (file)
@@ -18,7 +18,7 @@ struct intc_group {
     intc_enum enum_ids[32];
 };
 
-#define INTC_GROUP(enum_id, ids...) { enum_id, { ids } }
+#define INTC_GROUP(enum_id, ...) { enum_id, {  __VA_ARGS__ } }
 
 struct intc_mask_reg {
     unsigned long set_reg, clr_reg, reg_width;
index 9ee5ff89b0118d6639409122828cb55c301225d6..b68893490af7b2c5c18a2b4f892f5a9587248047 100644 (file)
 //#define DEBUG_IRQ
 
 #ifdef DEBUG_IRQ
-#define DPRINTF(fmt, args...) \
-do { printf("IRQ: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
 /*
index 8da7f4ad98e915b7934daa409888ea12ac58d7b7..ecece54e543ca9573c9da7c4bf9093578a5c5e32 100644 (file)
  */
 
 #ifdef DEBUG_MISC
-#define MISC_DPRINTF(fmt, args...) \
-do { printf("MISC: " fmt , ##args); } while (0)
+#define MISC_DPRINTF(fmt, ...)                                  \
+    do { printf("MISC: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define MISC_DPRINTF(fmt, args...)
+#define MISC_DPRINTF(fmt, ...)
 #endif
 
 typedef struct MiscState {
index 6a29ce27119e29c881244c88c71881bdc5b08efe..725b16d0e49a2f3679c100f7eadb415f2a1200f4 100644 (file)
 //#define DEBUG_TIMER
 
 #ifdef DEBUG_TIMER
-#define DPRINTF(fmt, args...) \
-do { printf("TIMER: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("TIMER: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while (0)
+#define DPRINTF(fmt, ...) do {} while (0)
 #endif
 
 /*
index fe3782bf4a404ebbf9b5988cbd4e16a319096b4d..316aba2c616aeaab18fecc1663158a70e8bac5d0 100644 (file)
@@ -47,9 +47,9 @@
 //#define DEBUG_BITBLT
 
 #ifdef DEBUG_SM501
-#define SM501_DPRINTF(fmt...) printf(fmt)
+#define SM501_DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__)
 #else
-#define SM501_DPRINTF(fmt...) do {} while(0)
+#define SM501_DPRINTF(fmt...) do {} while(0)
 #endif
 
 
index 6eb84124017965becfe4c7b0edc65150320f4cdc..222c3fdc925a1bc4eab46738c19ee602f63f061b 100644 (file)
 //#define DEBUG_SMBUS 1
 
 #ifdef DEBUG_SMBUS
-#define DPRINTF(fmt, args...) \
-do { printf("smbus(%02x): " fmt , dev->i2c.address, ##args); } while (0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "smbus: error: " fmt , ##args); exit(1);} while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("smbus(%02x): " fmt , dev->i2c.address, ## __VA_ARGS__); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "smbus: error: " fmt , ##args);} while (0)
+#define DPRINTF(fmt, ...) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__);} while (0)
 #endif
 
 enum {
index b1495dd953bf9fdfe4892c996924bed6bfa63ab8..cab9af77e884f75fea1ef141125c1cab716b5e6d 100644 (file)
  */
 
 #ifdef DEBUG_DMA
-#define DPRINTF(fmt, args...) \
-do { printf("DMA: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                               \
+    do { printf("DMA: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
 #define DMA_REGS 4
index 56cf72d932654365a4da49e229508776fb45396e..f13f804d7a520c5e53c35523e48cc5e4a7506756 100644 (file)
 //#define DEBUG_SSD0303 1
 
 #ifdef DEBUG_SSD0303
-#define DPRINTF(fmt, args...) \
-do { printf("ssd0303: " fmt , ##args); } while (0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "ssd0303: error: " fmt , ##args); exit(1);} while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("ssd0303: " fmt , ## __VA_ARGS__); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "ssd0303: error: " fmt , ##args);} while (0)
+#define DPRINTF(fmt, ...) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__);} while (0)
 #endif
 
 /* Scaling factor for pixels.  */
index b640dd093b4f8cf13aab2de516c1c84f487ff456..5b83d276079b1a1ccb0fd8b09db55cc5a46ff8bc 100644 (file)
 //#define DEBUG_SSD0323 1
 
 #ifdef DEBUG_SSD0323
-#define DPRINTF(fmt, args...) \
-do { printf("ssd0323: " fmt , ##args); } while (0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "ssd0323: error: " fmt , ##args); exit(1);} while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("ssd0323: " fmt , ## __VA_ARGS__); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "ssd0323: error: " fmt , ##args);} while (0)
+#define DPRINTF(fmt, ...) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__);} while (0)
 #endif
 
 /* Scaling factor for pixels.  */
index 93d2374958f95c2169573f391bd60cc36badc5e7..a1af85b70c7f423354e44e643d2b9869a960691a 100644 (file)
 //#define DEBUG_SSI_SD 1
 
 #ifdef DEBUG_SSI_SD
-#define DPRINTF(fmt, args...) \
-do { printf("ssi_sd: " fmt , ##args); } while (0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "ssi_sd: error: " fmt , ##args); exit(1);} while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("ssi_sd: " fmt , ## __VA_ARGS__); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "ssi_sd: error: " fmt , ##args);} while (0)
+#define DPRINTF(fmt, ...) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__);} while (0)
 #endif
 
 typedef enum {
index c9a0909e9b14edcc5946ee39d0edcc06466d02e7..d1ec61a5ce123d7ec6dbdd3bdd0e525609ad8500 100644 (file)
 //#define DEBUG_STELLARIS_ENET 1
 
 #ifdef DEBUG_STELLARIS_ENET
-#define DPRINTF(fmt, args...) \
-do { printf("stellaris_enet: " fmt , ##args); } while (0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "stellaris_enet: error: " fmt , ##args); exit(1);} while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("stellaris_enet: " fmt , ## __VA_ARGS__); } while (0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
-#define BADF(fmt, args...) \
-do { fprintf(stderr, "stellaris_enet: error: " fmt , ##args);} while (0)
+#define DPRINTF(fmt, ...) do {} while(0)
+#define BADF(fmt, ...) \
+do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__);} while (0)
 #endif
 
 #define SE_INT_RX       0x01
index 33df65309c1c5ec8ae88d80314c8e8bf112280c0..1b555578cefc7dda042429ac670bf77900cb3717 100644 (file)
 //#define DEBUG_IRQ
 
 #ifdef DEBUG_IRQ
-#define DPRINTF(fmt, args...) \
-do { printf("IRQ: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
 /*
index 8c7451ba40cb9df6eaef4eb32d4cf64586c2d01a..786b731b9e01157671f3bfbc8b1a8fa2a570c8d3 100644 (file)
  */
 
 #ifdef DEBUG_IRQ
-#define DPRINTF(fmt, args...)                           \
-    do { printf("CPUIRQ: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
 #define KERNEL_LOAD_ADDR     0x00004000
index 6dd4c0b9886bcdd46a5a6293bd94496606dee6ca..1c8b136024e987875613c11de6fc808c0585784d 100644 (file)
 //#define DEBUG_IRQ
 
 #ifdef DEBUG_IRQ
-#define DPRINTF(fmt, args...)                           \
-    do { printf("CPUIRQ: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...)                                       \
+    do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...)
+#define DPRINTF(fmt, ...)
 #endif
 
 #define KERNEL_LOAD_ADDR     0x00404000
index b751916796a05b335c145b64832f6530eba76300..8277b67a2d55121e098a4a3232faffb59597f1ea 100644 (file)
 //#define DEBUG_UNIN
 
 #ifdef DEBUG_UNIN
-#define UNIN_DPRINTF(fmt, args...) \
-do { printf("UNIN: " fmt , ##args); } while (0)
+#define UNIN_DPRINTF(fmt, ...)                                  \
+    do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define UNIN_DPRINTF(fmt, args...)
+#define UNIN_DPRINTF(fmt, ...)
 #endif
 
 typedef target_phys_addr_t pci_addr_t;
index 41c92c3f1dfda85239450b0387af73e3183b2369..3a3eb4a9a49934a9f4c9da4036430e429440b1e8 100644 (file)
 //#define DEBUG_MSD
 
 #ifdef DEBUG_MSD
-#define DPRINTF(fmt, args...) \
-do { printf("usb-msd: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("usb-msd: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
+#define DPRINTF(fmt, ...) do {} while(0)
 #endif
 
 /* USB requests.  */
index 52084822fc95522c03cd56bc04ae0397832e99c4..be231f91ed2b199c02b93ff3bb5368672df39f98 100644 (file)
 //#define DEBUG_Serial
 
 #ifdef DEBUG_Serial
-#define DPRINTF(fmt, args...) \
-do { printf("usb-serial: " fmt , ##args); } while (0)
+#define DPRINTF(fmt, ...) \
+do { printf("usb-serial: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF(fmt, args...) do {} while(0)
+#define DPRINTF(fmt, ...) do {} while(0)
 #endif
 
 #define RECV_BUF 384
index 00e0312691ef3d567b9220dc00bff1dec90ff9cc..8eba5a8197523b793a19ef78373034cc74f50320 100644 (file)
@@ -47,9 +47,9 @@
 //#define DEBUG
 
 #ifdef DEBUG
-#define        DBG_FLT(a...)   printf(a)
+#define        DBG_FLT(...)    printf(__VA_ARGS__)
 #else
-#define        DBG_FLT(a...)
+#define        DBG_FLT(...)
 #endif
 
 #define flat_reloc_valid(reloc, size)             ((reloc) <= (size))
index dc39b05d23b9f4741a8fd80e80ec4869124c7d4d..0d36978ad6818649ffe7b1b8634c81fa06f133a1 100644 (file)
@@ -1080,12 +1080,12 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val)
     return -1;
 }
 
-#define EXCP_DUMP(env, fmt, args...)                                         \
-do {                                                                          \
-    fprintf(stderr, fmt , ##args);                                            \
-    cpu_dump_state(env, stderr, fprintf, 0);                                  \
-    qemu_log(fmt, ##args);                                                   \
-    log_cpu_state(env, 0);                                                      \
+#define EXCP_DUMP(env, fmt, ...)                                        \
+do {                                                                    \
+    fprintf(stderr, fmt , ## __VA_ARGS__);                              \
+    cpu_dump_state(env, stderr, fprintf, 0);                            \
+    qemu_log(fmt, ## __VA_ARGS__);                                      \
+    log_cpu_state(env, 0);                                              \
 } while (0)
 
 void cpu_loop(CPUPPCState *env)
index 0bc9902ebcccb5e912135613d142a74a910eb802..76f0c95b9de505c9a9effb4ac9167ee0e91b0a87 100644 (file)
@@ -2563,7 +2563,7 @@ static abi_long do_ipc(unsigned int call, int first,
 /* kernel structure types definitions */
 #define IFNAMSIZ        16
 
-#define STRUCT(name, list...) STRUCT_ ## name,
+#define STRUCT(name, ...) STRUCT_ ## name,
 #define STRUCT_SPECIAL(name) STRUCT_ ## name,
 enum {
 #include "syscall_types.h"
@@ -2571,7 +2571,7 @@ enum {
 #undef STRUCT
 #undef STRUCT_SPECIAL
 
-#define STRUCT(name, list...) static const argtype struct_ ## name ## _def[] = { list, TYPE_NULL };
+#define STRUCT(name, ...) static const argtype struct_ ## name ## _def[] = {  __VA_ARGS__, TYPE_NULL };
 #define STRUCT_SPECIAL(name)
 #include "syscall_types.h"
 #undef STRUCT
@@ -2592,8 +2592,8 @@ typedef struct IOCTLEntry {
 #define MAX_STRUCT_SIZE 4096
 
 static IOCTLEntry ioctl_entries[] = {
-#define IOCTL(cmd, access, types...) \
-    { TARGET_ ## cmd, cmd, #cmd, access, { types } },
+#define IOCTL(cmd, access, ...) \
+    { TARGET_ ## cmd, cmd, #cmd, access, {  __VA_ARGS__ } },
 #include "ioctls.h"
     { 0, 0, },
 };
@@ -3497,7 +3497,7 @@ void syscall_init(void)
     int size;
     int i;
 
-#define STRUCT(name, list...) thunk_register_struct(STRUCT_ ## name, #name, struct_ ## name ## _def);
+#define STRUCT(name, ...) thunk_register_struct(STRUCT_ ## name, #name, struct_ ## name ## _def);
 #define STRUCT_SPECIAL(name) thunk_register_struct_direct(STRUCT_ ## name, #name, &struct_ ## name ## _def);
 #include "syscall_types.h"
 #undef STRUCT
index 8a97660abc0467849266ade7909a0779c17803c7..ae71e460b6853015d4b43ba369d3a4f6ca0fb61f 100644 (file)
@@ -43,10 +43,10 @@ const char *bootp_filename;
 static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE };
 
 #ifdef DEBUG
-#define dprintf(fmt, args...) \
-if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## args); fflush(dfd); }
+#define dprintf(fmt, ...) \
+if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ##  __VA_ARGS__); fflush(dfd); }
 #else
-#define dprintf(fmt, args...)
+#define dprintf(fmt, ...)
 #endif
 
 static BOOTPClient *get_new_addr(struct in_addr *paddr)
index 99d483a28747a5bb7a63633f4b2676ddc2d36761..35ac2117fdd98f3d3db2243d6d56cc3fea7f6f4b 100644 (file)
@@ -20,7 +20,7 @@
  */
 #if SHIFT == 0
 #define Reg MMXReg
-#define XMM_ONLY(x...)
+#define XMM_ONLY(...)
 #define B(n) MMX_B(n)
 #define W(n) MMX_W(n)
 #define L(n) MMX_L(n)
@@ -28,7 +28,7 @@
 #define SUFFIX _mmx
 #else
 #define Reg XMMReg
-#define XMM_ONLY(x...) x
+#define XMM_ONLY(...) __VA_ARGS__
 #define B(n) XMM_B(n)
 #define W(n) XMM_W(n)
 #define L(n) XMM_L(n)
index 8df3ea439c99bb1a2d502dffab65296488d7dbdd..3933697ef112405fd7d1c86f8e559228185cd17c 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifdef TARGET_X86_64
 #define X86_64_ONLY(x) x
-#define X86_64_DEF(x...) x
+#define X86_64_DEF(...)  __VA_ARGS__
 #define CODE64(s) ((s)->code64)
 #define REX_X(s) ((s)->rex_x)
 #define REX_B(s) ((s)->rex_b)
@@ -52,7 +52,7 @@
 #endif
 #else
 #define X86_64_ONLY(x) NULL
-#define X86_64_DEF(x...)
+#define X86_64_DEF(...)
 #define CODE64(s) 0
 #define REX_X(s) 0
 #define REX_B(s) 0
index 7ecc9fdaf311753f925662a4124da52cf43b58ad..6f5bea4b04000aca4b84212f3734ed2714e2b6e0 100644 (file)
@@ -501,13 +501,13 @@ static const char *fregnames[] =
       "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", };
 
 #ifdef MIPS_DEBUG_DISAS
-#define MIPS_DEBUG(fmt, args...)                         \
+#define MIPS_DEBUG(fmt, ...)                         \
         qemu_log_mask(CPU_LOG_TB_IN_ASM,                \
                        TARGET_FMT_lx ": %08x " fmt "\n", \
-                       ctx->pc, ctx->opcode , ##args)
+                       ctx->pc, ctx->opcode , ## __VA_ARGS__)
 #define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
 #else
-#define MIPS_DEBUG(fmt, args...) do { } while(0)
+#define MIPS_DEBUG(fmt, ...) do { } while(0)
 #define LOG_DISAS(...) do { } while (0)
 #endif
 
index 9de74c46c2f4d1db0df878f178e32fb0c1b1e1e1..a1f505493a23303c438679d1fb7aa32eb0a2394f 100644 (file)
 //#define DEBUG_PCALL
 
 #ifdef DEBUG_MMU
-#define DPRINTF_MMU(fmt, args...) \
-do { printf("MMU: " fmt , ##args); } while (0)
+#define DPRINTF_MMU(fmt, ...)                                   \
+    do { printf("MMU: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF_MMU(fmt, args...) do {} while (0)
+#define DPRINTF_MMU(fmt, ...) do {} while (0)
 #endif
 
 #ifdef DEBUG_MXCC
-#define DPRINTF_MXCC(fmt, args...) \
-do { printf("MXCC: " fmt , ##args); } while (0)
+#define DPRINTF_MXCC(fmt, ...)                                  \
+    do { printf("MXCC: " fmt , ## __VA_ARGS__); } while (0)
 #else
-#define DPRINTF_MXCC(fmt, args...) do {} while (0)
+#define DPRINTF_MXCC(fmt, ...) do {} while (0)
 #endif
 
 #ifdef DEBUG_ASI
-#define DPRINTF_ASI(fmt, args...) \
-do { printf("ASI: " fmt , ##args); } while (0)
+#define DPRINTF_ASI(fmt, ...)                                   \
+    do { printf("ASI: " fmt , ## __VA_ARGS__); } while (0)
 #endif
 
 #ifdef TARGET_SPARC64
index 19c0e1abb9b20c12fb29990b4c7de418e21b1438..934b7eeefb7756fbcf29dfc5bd6a4d003888aecc 100644 (file)
@@ -65,7 +65,7 @@ int __chk_error(const char *filename, int line, int ret)
     return ret;
 }
 
-#define error(fmt, args...) error1(__FILE__, __LINE__, fmt, ##args)
+#define error(fmt, ...) error1(__FILE__, __LINE__, fmt, ## __VA_ARGS__)
 
 #define chk_error(ret) __chk_error(__FILE__, __LINE__, (ret))