Replace gcc variadic macro extension with C99 version

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2009-05-13 17:53:17 +00:00
parent 4cfce484c5
commit 001faf3269
70 changed files with 268 additions and 268 deletions

View File

@ -73,10 +73,10 @@
//#define DEBUG_BLOCK //#define DEBUG_BLOCK
#if defined(DEBUG_BLOCK) #if defined(DEBUG_BLOCK)
#define DEBUG_BLOCK_PRINT(formatCstr, args...) do { if (qemu_log_enabled()) \ #define DEBUG_BLOCK_PRINT(formatCstr, ...) do { if (qemu_log_enabled()) \
{ qemu_log(formatCstr, ##args); qemu_log_flush(); } } while (0) { qemu_log(formatCstr, ## __VA_ARGS__); qemu_log_flush(); } } while (0)
#else #else
#define DEBUG_BLOCK_PRINT(formatCstr, args...) #define DEBUG_BLOCK_PRINT(formatCstr, ...)
#endif #endif
/* OS X does not have O_DSYNC */ /* OS X does not have O_DSYNC */

View File

@ -158,11 +158,11 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val)
return -1; return -1;
} }
#define EXCP_DUMP(env, fmt, args...) \ #define EXCP_DUMP(env, fmt, ...) \
do { \ do { \
fprintf(stderr, fmt , ##args); \ fprintf(stderr, fmt , ## __VA_ARGS__); \
cpu_dump_state(env, stderr, fprintf, 0); \ cpu_dump_state(env, stderr, fprintf, 0); \
qemu_log(fmt, ##args); \ qemu_log(fmt, ## __VA_ARGS__); \
log_cpu_state(env, 0); \ log_cpu_state(env, 0); \
} while (0) } while (0)

View File

@ -627,7 +627,7 @@ static inline void byteswap_winsize(struct winsize *w)
tswap16s(&w->ws_ypixel); tswap16s(&w->ws_ypixel);
} }
#define STRUCT(name, list...) STRUCT_ ## name, #define STRUCT(name, ...) STRUCT_ ## name,
#define STRUCT_SPECIAL(name) STRUCT_ ## name, #define STRUCT_SPECIAL(name) STRUCT_ ## name,
enum { enum {
#include "ioctls_types.h" #include "ioctls_types.h"
@ -635,7 +635,7 @@ enum {
#undef STRUCT #undef STRUCT
#undef STRUCT_SPECIAL #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) #define STRUCT_SPECIAL(name)
#include "ioctls_types.h" #include "ioctls_types.h"
#undef STRUCT #undef STRUCT
@ -656,8 +656,8 @@ typedef struct IOCTLEntry {
#define MAX_STRUCT_SIZE 4096 #define MAX_STRUCT_SIZE 4096
static IOCTLEntry ioctl_entries[] = { static IOCTLEntry ioctl_entries[] = {
#define IOCTL(cmd, access, types...) \ #define IOCTL(cmd, access, ...) \
{ cmd, cmd, #cmd, access, { types } }, { cmd, cmd, #cmd, access, { __VA_ARGS__ } },
#include "ioctls.h" #include "ioctls.h"
{ 0, 0, }, { 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_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_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_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_DIRECT(function, nargs, ...) WRAPPER_CALL_DIRECT_##nargs(function, __VA_ARGS__)
#define WRAPPER_CALL_NOERRNO(function, nargs, args...) WRAPPER_CALL_DIRECT(function, nargs, args) #define WRAPPER_CALL_NOERRNO(function, nargs, ...) WRAPPER_CALL_DIRECT(function, nargs, __VA_ARGS__)
#define WRAPPER_CALL_INDIRECT(function, nargs, args...) #define WRAPPER_CALL_INDIRECT(function, nargs, ...)
#define ENTRY(name, number, function, nargs, call_type, args...) WRAPPER_##call_type(function, nargs, args) #define ENTRY(name, number, function, nargs, call_type, ...) WRAPPER_##call_type(function, nargs, __VA_ARGS__)
#include "syscalls.h" #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_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_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_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_DIRECT 1
#define CALL_INDIRECT 2 #define CALL_INDIRECT 2

View File

@ -29,10 +29,10 @@
//#define DEBUG_ADB //#define DEBUG_ADB
#ifdef DEBUG_ADB #ifdef DEBUG_ADB
#define ADB_DPRINTF(fmt, args...) \ #define ADB_DPRINTF(fmt, ...) \
do { printf("ADB: " fmt , ##args); } while (0) do { printf("ADB: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define ADB_DPRINTF(fmt, args...) #define ADB_DPRINTF(fmt, ...)
#endif #endif
/* ADB commands */ /* ADB commands */

View File

@ -33,10 +33,10 @@
//#define DEBUG_APB //#define DEBUG_APB
#ifdef DEBUG_APB #ifdef DEBUG_APB
#define APB_DPRINTF(fmt, args...) \ #define APB_DPRINTF(fmt, ...) \
do { printf("APB: " fmt , ##args); } while (0) do { printf("APB: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define APB_DPRINTF(fmt, args...) #define APB_DPRINTF(fmt, ...)
#endif #endif
typedef target_phys_addr_t pci_addr_t; typedef target_phys_addr_t pci_addr_t;

View File

@ -14,10 +14,10 @@
//#define DEBUG_GIC //#define DEBUG_GIC
#ifdef DEBUG_GIC #ifdef DEBUG_GIC
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("arm_gic: " fmt , ##args); } while (0) do { printf("arm_gic: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#endif #endif
#ifdef NVIC #ifdef NVIC

View File

@ -46,10 +46,10 @@ typedef struct CSState {
#define CS_CDC_VER 0x8a #define CS_CDC_VER 0x8a
#ifdef DEBUG_CS #ifdef DEBUG_CS
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("CS: " fmt , ##args); } while (0) do { printf("CS: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
static void cs_reset(void *opaque) static void cs_reset(void *opaque)

View File

@ -36,10 +36,10 @@
//#define DEBUG_CUDA_PACKET //#define DEBUG_CUDA_PACKET
#ifdef DEBUG_CUDA #ifdef DEBUG_CUDA
#define CUDA_DPRINTF(fmt, args...) \ #define CUDA_DPRINTF(fmt, ...) \
do { printf("CUDA: " fmt , ##args); } while (0) do { printf("CUDA: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define CUDA_DPRINTF(fmt, args...) #define CUDA_DPRINTF(fmt, ...)
#endif #endif
/* Bits in B data register: all active low */ /* Bits in B data register: all active low */

View File

@ -34,8 +34,8 @@
#endif #endif
#ifdef DEBUG_SONIC #ifdef DEBUG_SONIC
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("sonic: " fmt , ##args); } while (0) do { printf("sonic: " fmt , ## __VA_ARGS__); } while (0)
static const char* reg_names[] = { static const char* reg_names[] = {
"CR", "DCR", "RCR", "TCR", "IMR", "ISR", "UTDA", "CTDA", "CR", "DCR", "RCR", "TCR", "IMR", "ISR", "UTDA", "CTDA",
"TPS", "TFC", "TSA0", "TSA1", "TFS", "URDA", "CRDA", "CRBA0", "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", "0x30", "0x31", "0x32", "0x33", "0x34", "0x35", "0x36", "0x37",
"0x38", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "DCR2" }; "0x38", "0x39", "0x3a", "0x3b", "0x3c", "0x3d", "0x3e", "DCR2" };
#else #else
#define DPRINTF(fmt, args...) do {} while (0) #define DPRINTF(fmt, ...) do {} while (0)
#endif #endif
#define SONIC_ERROR(fmt, args...) \ #define SONIC_ERROR(fmt, ...) \
do { printf("sonic ERROR: %s: " fmt, __func__ , ##args); } while (0) do { printf("sonic ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
#define SONIC_CR 0x00 #define SONIC_CR 0x00
#define SONIC_DCR 0x01 #define SONIC_DCR 0x01

View File

@ -28,10 +28,10 @@
//#define DEBUG_ECC //#define DEBUG_ECC
#ifdef DEBUG_ECC #ifdef DEBUG_ECC
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("ECC: " fmt , ##args); } while (0) do { printf("ECC: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
/* There are 3 versions of this chip used in SMP sun4m systems: /* There are 3 versions of this chip used in SMP sun4m systems:

View File

@ -60,9 +60,9 @@
//~ #define DEBUG_EEPRO100 //~ #define DEBUG_EEPRO100
#ifdef 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 #else
#define logout(fmt, args...) ((void)0) #define logout(fmt, ...) ((void)0)
#endif #endif
/* Set flags to 0 to disable debug output. */ /* Set flags to 0 to disable debug output. */

View File

@ -44,9 +44,9 @@
//~ #define DEBUG_EEPROM //~ #define DEBUG_EEPROM
#ifdef 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 #else
#define logout(fmt, args...) ((void)0) #define logout(fmt, ...) ((void)0)
#endif #endif
#define EEPROM_INSTANCE 0 #define EEPROM_INSTANCE 0

View File

@ -62,22 +62,22 @@
*/ */
#ifdef DEBUG_SERIAL #ifdef DEBUG_SERIAL
#define SER_DPRINTF(fmt, args...) \ #define SER_DPRINTF(fmt, ...) \
do { printf("SER: " fmt , ##args); } while (0) do { printf("SER: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define SER_DPRINTF(fmt, args...) #define SER_DPRINTF(fmt, ...)
#endif #endif
#ifdef DEBUG_KBD #ifdef DEBUG_KBD
#define KBD_DPRINTF(fmt, args...) \ #define KBD_DPRINTF(fmt, ...) \
do { printf("KBD: " fmt , ##args); } while (0) do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define KBD_DPRINTF(fmt, args...) #define KBD_DPRINTF(fmt, ...)
#endif #endif
#ifdef DEBUG_MOUSE #ifdef DEBUG_MOUSE
#define MS_DPRINTF(fmt, args...) \ #define MS_DPRINTF(fmt, ...) \
do { printf("MSC: " fmt , ##args); } while (0) do { printf("MSC: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define MS_DPRINTF(fmt, args...) #define MS_DPRINTF(fmt, ...)
#endif #endif
typedef enum { typedef enum {

View File

@ -38,14 +38,14 @@
*/ */
#ifdef DEBUG_ESP #ifdef DEBUG_ESP
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("ESP: " fmt , ##args); } while (0) do { printf("ESP: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while (0) #define DPRINTF(fmt, ...) do {} while (0)
#endif #endif
#define ESP_ERROR(fmt, args...) \ #define ESP_ERROR(fmt, ...) \
do { printf("ESP ERROR: %s: " fmt, __func__ , ##args); } while (0) do { printf("ESP ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
#define ESP_REGS 16 #define ESP_REGS 16
#define TI_BUFSZ 16 #define TI_BUFSZ 16

View File

@ -37,14 +37,14 @@
//#define DEBUG_FLOPPY //#define DEBUG_FLOPPY
#ifdef DEBUG_FLOPPY #ifdef DEBUG_FLOPPY
#define FLOPPY_DPRINTF(fmt, args...) \ #define FLOPPY_DPRINTF(fmt, ...) \
do { printf("FLOPPY: " fmt , ##args); } while (0) do { printf("FLOPPY: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define FLOPPY_DPRINTF(fmt, args...) #define FLOPPY_DPRINTF(fmt, ...)
#endif #endif
#define FLOPPY_ERROR(fmt, args...) \ #define FLOPPY_ERROR(fmt, ...) \
do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ##args); } while (0) do { printf("FLOPPY ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
/********************************************************/ /********************************************************/
/* Floppy drive emulation */ /* Floppy drive emulation */

View File

@ -30,10 +30,10 @@
//#define DEBUG_FW_CFG //#define DEBUG_FW_CFG
#ifdef DEBUG_FW_CFG #ifdef DEBUG_FW_CFG
#define FW_CFG_DPRINTF(fmt, args...) \ #define FW_CFG_DPRINTF(fmt, ...) \
do { printf("FW_CFG: " fmt , ##args); } while (0) do { printf("FW_CFG: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define FW_CFG_DPRINTF(fmt, args...) #define FW_CFG_DPRINTF(fmt, ...)
#endif #endif
#define FW_CFG_SIZE 2 #define FW_CFG_SIZE 2

View File

@ -26,13 +26,13 @@
//#define DEBUG_G364 //#define DEBUG_G364
#ifdef DEBUG_G364 #ifdef DEBUG_G364
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("g364: " fmt , ##args); } while (0) do { printf("g364: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while (0) #define DPRINTF(fmt, ...) do {} while (0)
#endif #endif
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "g364 ERROR: " fmt , ##args);} while (0) do { fprintf(stderr, "g364 ERROR: " fmt , ## __VA_ARGS__);} while (0)
typedef struct G364State { typedef struct G364State {
/* hardware */ /* hardware */

View File

@ -31,10 +31,10 @@
//#define DEBUG_GRACKLE //#define DEBUG_GRACKLE
#ifdef DEBUG_GRACKLE #ifdef DEBUG_GRACKLE
#define GRACKLE_DPRINTF(fmt, args...) \ #define GRACKLE_DPRINTF(fmt, ...) \
do { printf("GRACKLE: " fmt , ##args); } while (0) do { printf("GRACKLE: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define GRACKLE_DPRINTF(fmt, args...) #define GRACKLE_DPRINTF(fmt, ...)
#endif #endif
typedef target_phys_addr_t pci_addr_t; typedef target_phys_addr_t pci_addr_t;

View File

@ -29,10 +29,10 @@
//#define DEBUG_PIC //#define DEBUG_PIC
#ifdef DEBUG_PIC #ifdef DEBUG_PIC
#define PIC_DPRINTF(fmt, args...) \ #define PIC_DPRINTF(fmt, ...) \
do { printf("PIC: " fmt , ##args); } while (0) do { printf("PIC: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define PIC_DPRINTF(fmt, args...) #define PIC_DPRINTF(fmt, ...)
#endif #endif
typedef struct HeathrowPIC { typedef struct HeathrowPIC {

View File

@ -28,10 +28,10 @@
//#define DEBUG_IOMMU //#define DEBUG_IOMMU
#ifdef DEBUG_IOMMU #ifdef DEBUG_IOMMU
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("IOMMU: " fmt , ##args); } while (0) do { printf("IOMMU: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
#define IOMMU_NREGS (4*4096/4) #define IOMMU_NREGS (4*4096/4)

View File

@ -19,14 +19,14 @@
//#define DEBUG_LSI_REG //#define DEBUG_LSI_REG
#ifdef DEBUG_LSI #ifdef DEBUG_LSI
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("lsi_scsi: " fmt , ##args); } while (0) do { printf("lsi_scsi: " fmt , ## __VA_ARGS__); } while (0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "lsi_scsi: error: " fmt , ##args); exit(1);} while (0) do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "lsi_scsi: error: " fmt , ##args);} while (0) do { fprintf(stderr, "lsi_scsi: error: " fmt , ## __VA_ARGS__);} while (0)
#endif #endif
#define LSI_SCNTL0_TRG 0x01 #define LSI_SCNTL0_TRG 0x01

View File

@ -30,9 +30,9 @@
//#define DEBUG_NVRAM //#define DEBUG_NVRAM
#if defined(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 #else
#define NVRAM_PRINTF(fmt, args...) do { } while (0) #define NVRAM_PRINTF(fmt, ...) do { } while (0)
#endif #endif
/* /*

View File

@ -44,10 +44,10 @@
//#define DEBUG_DBDMA //#define DEBUG_DBDMA
#ifdef DEBUG_DBDMA #ifdef DEBUG_DBDMA
#define DBDMA_DPRINTF(fmt, args...) \ #define DBDMA_DPRINTF(fmt, ...) \
do { printf("DBDMA: " fmt , ##args); } while (0) do { printf("DBDMA: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DBDMA_DPRINTF(fmt, args...) #define DBDMA_DPRINTF(fmt, ...)
#endif #endif
/* /*

View File

@ -31,10 +31,10 @@
//#define DEBUG_NVR //#define DEBUG_NVR
#ifdef DEBUG_NVR #ifdef DEBUG_NVR
#define NVR_DPRINTF(fmt, args...) \ #define NVR_DPRINTF(fmt, ...) \
do { printf("NVR: " fmt , ##args); } while (0) do { printf("NVR: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define NVR_DPRINTF(fmt, args...) #define NVR_DPRINTF(fmt, ...)
#endif #endif
struct MacIONVRAMState { struct MacIONVRAMState {

View File

@ -14,10 +14,10 @@
//#define DEBUG_FEC 1 //#define DEBUG_FEC 1
#ifdef DEBUG_FEC #ifdef DEBUG_FEC
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("mcf_fec: " fmt , ##args); } while (0) do { printf("mcf_fec: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#endif #endif
#define FEC_MAX_FRAME_SIZE 2032 #define FEC_MAX_FRAME_SIZE 2032

View File

@ -114,9 +114,9 @@ static void malta_fpga_update_display(void *opaque)
//~ #define DEBUG //~ #define DEBUG
#if defined(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 #else
# define logout(fmt, args...) ((void)0) # define logout(fmt, ...) ((void)0)
#endif #endif
struct _eeprom24c0x_t { struct _eeprom24c0x_t {

View File

@ -40,9 +40,9 @@
//#define DEBUG_OPENPIC //#define DEBUG_OPENPIC
#ifdef 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 #else
#define DPRINTF(fmt, args...) do { } while (0) #define DPRINTF(fmt, ...) do { } while (0)
#endif #endif
#define USE_MPCxxx /* Intel model is broken, for now */ #define USE_MPCxxx /* Intel model is broken, for now */

View File

@ -30,9 +30,9 @@
//#define DEBUG_PARALLEL //#define DEBUG_PARALLEL
#ifdef DEBUG_PARALLEL #ifdef DEBUG_PARALLEL
#define pdebug(fmt, arg...) printf("pp: " fmt, ##arg) #define pdebug(fmt, ...) printf("pp: " fmt, ## __VA_ARGS__)
#else #else
#define pdebug(fmt, arg...) ((void)0) #define pdebug(fmt, ...) ((void)0)
#endif #endif
#define PARA_REG_DATA 0 #define PARA_REG_DATA 0

View File

@ -29,10 +29,10 @@
//#define DEBUG_PCI //#define DEBUG_PCI
#ifdef DEBUG_PCI #ifdef DEBUG_PCI
#define PCI_DPRINTF(fmt, args...) \ #define PCI_DPRINTF(fmt, ...) \
do { printf("pci_host_data: " fmt , ##args); } while (0) do { printf("pci_host_data: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define PCI_DPRINTF(fmt, args...) #define PCI_DPRINTF(fmt, ...)
#endif #endif
typedef struct { typedef struct {

View File

@ -42,20 +42,20 @@
#include "block.h" #include "block.h"
#include "qemu-timer.h" #include "qemu-timer.h"
#define PFLASH_BUG(fmt, args...) \ #define PFLASH_BUG(fmt, ...) \
do { \ do { \
printf("PFLASH: Possible BUG - " fmt, ##args); \ printf("PFLASH: Possible BUG - " fmt, ## __VA_ARGS__); \
exit(1); \ exit(1); \
} while(0) } while(0)
/* #define PFLASH_DEBUG */ /* #define PFLASH_DEBUG */
#ifdef PFLASH_DEBUG #ifdef PFLASH_DEBUG
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { \ do { \
printf("PFLASH: " fmt , ##args); \ printf("PFLASH: " fmt , ## __VA_ARGS__); \
} while (0) } while (0)
#else #else
#define DPRINTF(fmt, args...) do { } while (0) #define DPRINTF(fmt, ...) do { } while (0)
#endif #endif
struct pflash_t { struct pflash_t {

View File

@ -43,12 +43,12 @@
//#define PFLASH_DEBUG //#define PFLASH_DEBUG
#ifdef PFLASH_DEBUG #ifdef PFLASH_DEBUG
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { \ do { \
printf("PFLASH: " fmt , ##args); \ printf("PFLASH: " fmt , ## __VA_ARGS__); \
} while (0) } while (0)
#else #else
#define DPRINTF(fmt, args...) do { } while (0) #define DPRINTF(fmt, ...) do { } while (0)
#endif #endif
struct pflash_t { struct pflash_t {

View File

@ -13,14 +13,14 @@
//#define DEBUG_PL022 1 //#define DEBUG_PL022 1
#ifdef DEBUG_PL022 #ifdef DEBUG_PL022
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("pl022: " fmt , ##args); } while (0) do { printf("pl022: " fmt , ## __VA_ARGS__); } while (0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "pl022: error: " fmt , ##args); exit(1);} while (0) do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "pl022: error: " fmt , ##args);} while (0) do { fprintf(stderr, "pl022: error: " fmt , ## __VA_ARGS__);} while (0)
#endif #endif
#define PL022_CR1_LBM 0x01 #define PL022_CR1_LBM 0x01

View File

@ -16,10 +16,10 @@
//#define DEBUG_PL031 //#define DEBUG_PL031
#ifdef DEBUG_PL031 #ifdef DEBUG_PL031
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("pl031: " fmt , ##args); } while (0) do { printf("pl031: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#endif #endif
#define RTC_DR 0x00 /* Data read register */ #define RTC_DR 0x00 /* Data read register */

View File

@ -14,14 +14,14 @@
//#define DEBUG_PL061 1 //#define DEBUG_PL061 1
#ifdef DEBUG_PL061 #ifdef DEBUG_PL061
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("pl061: " fmt , ##args); } while (0) do { printf("pl061: " fmt , ## __VA_ARGS__); } while (0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "pl061: error: " fmt , ##args); exit(1);} while (0) do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "pl061: error: " fmt , ##args);} while (0) do { fprintf(stderr, "pl061: error: " fmt , ## __VA_ARGS__);} while (0)
#endif #endif
static const uint8_t pl061_id[12] = static const uint8_t pl061_id[12] =

View File

@ -14,10 +14,10 @@
//#define DEBUG_PL181 1 //#define DEBUG_PL181 1
#ifdef DEBUG_PL181 #ifdef DEBUG_PL181
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("pl181: " fmt , ##args); } while (0) do { printf("pl181: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#endif #endif
#define PL181_FIFO_LEN 16 #define PL181_FIFO_LEN 16

View File

@ -33,7 +33,7 @@ typedef target_phys_addr_t pci_addr_t;
#ifdef DEBUG #ifdef DEBUG
#define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0) #define DPRINTF(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif /* DEBUG */ #endif /* DEBUG */
struct PCIMasterMap { struct PCIMasterMap {

View File

@ -44,10 +44,10 @@
//#define DEBUG_UNIN //#define DEBUG_UNIN
#ifdef DEBUG_UNIN #ifdef DEBUG_UNIN
#define UNIN_DPRINTF(fmt, args...) \ #define UNIN_DPRINTF(fmt, ...) \
do { printf("UNIN: " fmt , ##args); } while (0) do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define UNIN_DPRINTF(fmt, args...) #define UNIN_DPRINTF(fmt, ...)
#endif #endif
/* UniN device */ /* UniN device */

View File

@ -50,18 +50,18 @@
#endif #endif
#if defined (HARD_DEBUG_PPC_IO) #if defined (HARD_DEBUG_PPC_IO)
#define PPC_IO_DPRINTF(fmt, args...) \ #define PPC_IO_DPRINTF(fmt, ...) \
do { \ do { \
if (qemu_loglevel_mask(CPU_LOG_IOPORT)) { \ if (qemu_loglevel_mask(CPU_LOG_IOPORT)) { \
qemu_log("%s: " fmt, __func__ , ##args); \ qemu_log("%s: " fmt, __func__ , ## __VA_ARGS__); \
} else { \ } else { \
printf("%s : " fmt, __func__ , ##args); \ printf("%s : " fmt, __func__ , ## __VA_ARGS__); \
} \ } \
} while (0) } while (0)
#elif defined (DEBUG_PPC_IO) #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 #else
#define PPC_IO_DPRINTF(fmt, args...) do { } while (0) #define PPC_IO_DPRINTF(fmt, ...) do { } while (0)
#endif #endif
/* Constants for devices init */ /* Constants for devices init */

View File

@ -24,9 +24,9 @@ typedef target_phys_addr_t pci_addr_t;
#include "qemu-log.h" #include "qemu-log.h"
#ifdef DEBUG_PCI #ifdef DEBUG_PCI
#define pci_debug(fmt, arg...) fprintf(stderr, fmt, ##arg) #define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
#else #else
#define pci_debug(fmt, arg...) #define pci_debug(fmt, ...)
#endif #endif
#define PCIE500_CFGADDR 0x0 #define PCIE500_CFGADDR 0x0

View File

@ -33,16 +33,16 @@
//#define DEBUG_RC4030_DMA //#define DEBUG_RC4030_DMA
#ifdef DEBUG_RC4030 #ifdef DEBUG_RC4030
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("rc4030: " fmt , ##args); } while (0) do { printf("rc4030: " fmt , ## __VA_ARGS__); } while (0)
static const char* irq_names[] = { "parallel", "floppy", "sound", "video", static const char* irq_names[] = { "parallel", "floppy", "sound", "video",
"network", "scsi", "keyboard", "mouse", "serial0", "serial1" }; "network", "scsi", "keyboard", "mouse", "serial0", "serial1" };
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
#define RC4030_ERROR(fmt, args...) \ #define RC4030_ERROR(fmt, ...) \
do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ##args); } while (0) do { fprintf(stderr, "rc4030 ERROR: %s: " fmt, __func__ , ## __VA_ARGS__); } while (0)
/********************************************************/ /********************************************************/
/* rc4030 emulation */ /* rc4030 emulation */

View File

@ -28,10 +28,10 @@
//#define DEBUG_IRQ //#define DEBUG_IRQ
#ifdef DEBUG_IRQ #ifdef DEBUG_IRQ
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("IRQ: " fmt , ##args); } while (0) do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
#define MAX_CPUS 16 #define MAX_CPUS 16

View File

@ -18,14 +18,14 @@
//#define DEBUG_SCSI //#define DEBUG_SCSI
#ifdef DEBUG_SCSI #ifdef DEBUG_SCSI
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("scsi-disk: " fmt , ##args); } while (0) do { printf("scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#endif #endif
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "scsi-disk: " fmt , ##args); } while (0) do { fprintf(stderr, "scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
#include "qemu-common.h" #include "qemu-common.h"
#include "block.h" #include "block.h"

View File

@ -28,14 +28,14 @@ SCSIDevice *scsi_generic_init(BlockDriverState *bdrv, int tcq,
//#define DEBUG_SCSI //#define DEBUG_SCSI
#ifdef DEBUG_SCSI #ifdef DEBUG_SCSI
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("scsi-generic: " fmt , ##args); } while (0) do { printf("scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#endif #endif
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "scsi-generic: " fmt , ##args); } while (0) do { fprintf(stderr, "scsi-generic: " fmt , ## __VA_ARGS__); } while (0)
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>

View File

@ -36,10 +36,10 @@
//#define DEBUG_SD 1 //#define DEBUG_SD 1
#ifdef DEBUG_SD #ifdef DEBUG_SD
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { fprintf(stderr, "SD: " fmt , ##args); } while (0) do { fprintf(stderr, "SD: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#endif #endif
typedef enum { typedef enum {

View File

@ -18,7 +18,7 @@ struct intc_group {
intc_enum enum_ids[32]; 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 { struct intc_mask_reg {
unsigned long set_reg, clr_reg, reg_width; unsigned long set_reg, clr_reg, reg_width;

View File

@ -29,10 +29,10 @@
//#define DEBUG_IRQ //#define DEBUG_IRQ
#ifdef DEBUG_IRQ #ifdef DEBUG_IRQ
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("IRQ: " fmt , ##args); } while (0) do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
/* /*

View File

@ -37,10 +37,10 @@
*/ */
#ifdef DEBUG_MISC #ifdef DEBUG_MISC
#define MISC_DPRINTF(fmt, args...) \ #define MISC_DPRINTF(fmt, ...) \
do { printf("MISC: " fmt , ##args); } while (0) do { printf("MISC: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define MISC_DPRINTF(fmt, args...) #define MISC_DPRINTF(fmt, ...)
#endif #endif
typedef struct MiscState { typedef struct MiscState {

View File

@ -28,10 +28,10 @@
//#define DEBUG_TIMER //#define DEBUG_TIMER
#ifdef DEBUG_TIMER #ifdef DEBUG_TIMER
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("TIMER: " fmt , ##args); } while (0) do { printf("TIMER: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while (0) #define DPRINTF(fmt, ...) do {} while (0)
#endif #endif
/* /*

View File

@ -47,9 +47,9 @@
//#define DEBUG_BITBLT //#define DEBUG_BITBLT
#ifdef DEBUG_SM501 #ifdef DEBUG_SM501
#define SM501_DPRINTF(fmt...) printf(fmt) #define SM501_DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__)
#else #else
#define SM501_DPRINTF(fmt...) do {} while(0) #define SM501_DPRINTF(fmt, ...) do {} while(0)
#endif #endif

View File

@ -16,14 +16,14 @@
//#define DEBUG_SMBUS 1 //#define DEBUG_SMBUS 1
#ifdef DEBUG_SMBUS #ifdef DEBUG_SMBUS
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("smbus(%02x): " fmt , dev->i2c.address, ##args); } while (0) do { printf("smbus(%02x): " fmt , dev->i2c.address, ## __VA_ARGS__); } while (0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "smbus: error: " fmt , ##args); exit(1);} while (0) do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "smbus: error: " fmt , ##args);} while (0) do { fprintf(stderr, "smbus: error: " fmt , ## __VA_ARGS__);} while (0)
#endif #endif
enum { enum {

View File

@ -37,10 +37,10 @@
*/ */
#ifdef DEBUG_DMA #ifdef DEBUG_DMA
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("DMA: " fmt , ##args); } while (0) do { printf("DMA: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
#define DMA_REGS 4 #define DMA_REGS 4

View File

@ -17,14 +17,14 @@
//#define DEBUG_SSD0303 1 //#define DEBUG_SSD0303 1
#ifdef DEBUG_SSD0303 #ifdef DEBUG_SSD0303
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("ssd0303: " fmt , ##args); } while (0) do { printf("ssd0303: " fmt , ## __VA_ARGS__); } while (0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "ssd0303: error: " fmt , ##args); exit(1);} while (0) do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "ssd0303: error: " fmt , ##args);} while (0) do { fprintf(stderr, "ssd0303: error: " fmt , ## __VA_ARGS__);} while (0)
#endif #endif
/* Scaling factor for pixels. */ /* Scaling factor for pixels. */

View File

@ -17,14 +17,14 @@
//#define DEBUG_SSD0323 1 //#define DEBUG_SSD0323 1
#ifdef DEBUG_SSD0323 #ifdef DEBUG_SSD0323
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("ssd0323: " fmt , ##args); } while (0) do { printf("ssd0323: " fmt , ## __VA_ARGS__); } while (0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "ssd0323: error: " fmt , ##args); exit(1);} while (0) do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "ssd0323: error: " fmt , ##args);} while (0) do { fprintf(stderr, "ssd0323: error: " fmt , ## __VA_ARGS__);} while (0)
#endif #endif
/* Scaling factor for pixels. */ /* Scaling factor for pixels. */

View File

@ -13,14 +13,14 @@
//#define DEBUG_SSI_SD 1 //#define DEBUG_SSI_SD 1
#ifdef DEBUG_SSI_SD #ifdef DEBUG_SSI_SD
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("ssi_sd: " fmt , ##args); } while (0) do { printf("ssi_sd: " fmt , ## __VA_ARGS__); } while (0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "ssi_sd: error: " fmt , ##args); exit(1);} while (0) do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "ssi_sd: error: " fmt , ##args);} while (0) do { fprintf(stderr, "ssi_sd: error: " fmt , ## __VA_ARGS__);} while (0)
#endif #endif
typedef enum { typedef enum {

View File

@ -14,14 +14,14 @@
//#define DEBUG_STELLARIS_ENET 1 //#define DEBUG_STELLARIS_ENET 1
#ifdef DEBUG_STELLARIS_ENET #ifdef DEBUG_STELLARIS_ENET
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("stellaris_enet: " fmt , ##args); } while (0) do { printf("stellaris_enet: " fmt , ## __VA_ARGS__); } while (0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "stellaris_enet: error: " fmt , ##args); exit(1);} while (0) do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__); exit(1);} while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#define BADF(fmt, args...) \ #define BADF(fmt, ...) \
do { fprintf(stderr, "stellaris_enet: error: " fmt , ##args);} while (0) do { fprintf(stderr, "stellaris_enet: error: " fmt , ## __VA_ARGS__);} while (0)
#endif #endif
#define SE_INT_RX 0x01 #define SE_INT_RX 0x01

View File

@ -28,10 +28,10 @@
//#define DEBUG_IRQ //#define DEBUG_IRQ
#ifdef DEBUG_IRQ #ifdef DEBUG_IRQ
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("IRQ: " fmt , ##args); } while (0) do { printf("IRQ: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
/* /*

View File

@ -68,10 +68,10 @@
*/ */
#ifdef DEBUG_IRQ #ifdef DEBUG_IRQ
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("CPUIRQ: " fmt , ##args); } while (0) do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
#define KERNEL_LOAD_ADDR 0x00004000 #define KERNEL_LOAD_ADDR 0x00004000

View File

@ -36,10 +36,10 @@
//#define DEBUG_IRQ //#define DEBUG_IRQ
#ifdef DEBUG_IRQ #ifdef DEBUG_IRQ
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("CPUIRQ: " fmt , ##args); } while (0) do { printf("CPUIRQ: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) #define DPRINTF(fmt, ...)
#endif #endif
#define KERNEL_LOAD_ADDR 0x00404000 #define KERNEL_LOAD_ADDR 0x00404000

View File

@ -29,10 +29,10 @@
//#define DEBUG_UNIN //#define DEBUG_UNIN
#ifdef DEBUG_UNIN #ifdef DEBUG_UNIN
#define UNIN_DPRINTF(fmt, args...) \ #define UNIN_DPRINTF(fmt, ...) \
do { printf("UNIN: " fmt , ##args); } while (0) do { printf("UNIN: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define UNIN_DPRINTF(fmt, args...) #define UNIN_DPRINTF(fmt, ...)
#endif #endif
typedef target_phys_addr_t pci_addr_t; typedef target_phys_addr_t pci_addr_t;

View File

@ -16,10 +16,10 @@
//#define DEBUG_MSD //#define DEBUG_MSD
#ifdef DEBUG_MSD #ifdef DEBUG_MSD
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("usb-msd: " fmt , ##args); } while (0) do { printf("usb-msd: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#endif #endif
/* USB requests. */ /* USB requests. */

View File

@ -15,10 +15,10 @@
//#define DEBUG_Serial //#define DEBUG_Serial
#ifdef DEBUG_Serial #ifdef DEBUG_Serial
#define DPRINTF(fmt, args...) \ #define DPRINTF(fmt, ...) \
do { printf("usb-serial: " fmt , ##args); } while (0) do { printf("usb-serial: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF(fmt, args...) do {} while(0) #define DPRINTF(fmt, ...) do {} while(0)
#endif #endif
#define RECV_BUF 384 #define RECV_BUF 384

View File

@ -47,9 +47,9 @@
//#define DEBUG //#define DEBUG
#ifdef DEBUG #ifdef DEBUG
#define DBG_FLT(a...) printf(a) #define DBG_FLT(...) printf(__VA_ARGS__)
#else #else
#define DBG_FLT(a...) #define DBG_FLT(...)
#endif #endif
#define flat_reloc_valid(reloc, size) ((reloc) <= (size)) #define flat_reloc_valid(reloc, size) ((reloc) <= (size))

View File

@ -1080,11 +1080,11 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, target_ulong val)
return -1; return -1;
} }
#define EXCP_DUMP(env, fmt, args...) \ #define EXCP_DUMP(env, fmt, ...) \
do { \ do { \
fprintf(stderr, fmt , ##args); \ fprintf(stderr, fmt , ## __VA_ARGS__); \
cpu_dump_state(env, stderr, fprintf, 0); \ cpu_dump_state(env, stderr, fprintf, 0); \
qemu_log(fmt, ##args); \ qemu_log(fmt, ## __VA_ARGS__); \
log_cpu_state(env, 0); \ log_cpu_state(env, 0); \
} while (0) } while (0)

View File

@ -2563,7 +2563,7 @@ static abi_long do_ipc(unsigned int call, int first,
/* kernel structure types definitions */ /* kernel structure types definitions */
#define IFNAMSIZ 16 #define IFNAMSIZ 16
#define STRUCT(name, list...) STRUCT_ ## name, #define STRUCT(name, ...) STRUCT_ ## name,
#define STRUCT_SPECIAL(name) STRUCT_ ## name, #define STRUCT_SPECIAL(name) STRUCT_ ## name,
enum { enum {
#include "syscall_types.h" #include "syscall_types.h"
@ -2571,7 +2571,7 @@ enum {
#undef STRUCT #undef STRUCT
#undef STRUCT_SPECIAL #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) #define STRUCT_SPECIAL(name)
#include "syscall_types.h" #include "syscall_types.h"
#undef STRUCT #undef STRUCT
@ -2592,8 +2592,8 @@ typedef struct IOCTLEntry {
#define MAX_STRUCT_SIZE 4096 #define MAX_STRUCT_SIZE 4096
static IOCTLEntry ioctl_entries[] = { static IOCTLEntry ioctl_entries[] = {
#define IOCTL(cmd, access, types...) \ #define IOCTL(cmd, access, ...) \
{ TARGET_ ## cmd, cmd, #cmd, access, { types } }, { TARGET_ ## cmd, cmd, #cmd, access, { __VA_ARGS__ } },
#include "ioctls.h" #include "ioctls.h"
{ 0, 0, }, { 0, 0, },
}; };
@ -3497,7 +3497,7 @@ void syscall_init(void)
int size; int size;
int i; 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); #define STRUCT_SPECIAL(name) thunk_register_struct_direct(STRUCT_ ## name, #name, &struct_ ## name ## _def);
#include "syscall_types.h" #include "syscall_types.h"
#undef STRUCT #undef STRUCT

View File

@ -43,10 +43,10 @@ const char *bootp_filename;
static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE }; static const uint8_t rfc1533_cookie[] = { RFC1533_COOKIE };
#ifdef DEBUG #ifdef DEBUG
#define dprintf(fmt, args...) \ #define dprintf(fmt, ...) \
if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## args); fflush(dfd); } if (slirp_debug & DBG_CALL) { fprintf(dfd, fmt, ## __VA_ARGS__); fflush(dfd); }
#else #else
#define dprintf(fmt, args...) #define dprintf(fmt, ...)
#endif #endif
static BOOTPClient *get_new_addr(struct in_addr *paddr) static BOOTPClient *get_new_addr(struct in_addr *paddr)

View File

@ -20,7 +20,7 @@
*/ */
#if SHIFT == 0 #if SHIFT == 0
#define Reg MMXReg #define Reg MMXReg
#define XMM_ONLY(x...) #define XMM_ONLY(...)
#define B(n) MMX_B(n) #define B(n) MMX_B(n)
#define W(n) MMX_W(n) #define W(n) MMX_W(n)
#define L(n) MMX_L(n) #define L(n) MMX_L(n)
@ -28,7 +28,7 @@
#define SUFFIX _mmx #define SUFFIX _mmx
#else #else
#define Reg XMMReg #define Reg XMMReg
#define XMM_ONLY(x...) x #define XMM_ONLY(...) __VA_ARGS__
#define B(n) XMM_B(n) #define B(n) XMM_B(n)
#define W(n) XMM_W(n) #define W(n) XMM_W(n)
#define L(n) XMM_L(n) #define L(n) XMM_L(n)

View File

@ -42,7 +42,7 @@
#ifdef TARGET_X86_64 #ifdef TARGET_X86_64
#define X86_64_ONLY(x) x #define X86_64_ONLY(x) x
#define X86_64_DEF(x...) x #define X86_64_DEF(...) __VA_ARGS__
#define CODE64(s) ((s)->code64) #define CODE64(s) ((s)->code64)
#define REX_X(s) ((s)->rex_x) #define REX_X(s) ((s)->rex_x)
#define REX_B(s) ((s)->rex_b) #define REX_B(s) ((s)->rex_b)
@ -52,7 +52,7 @@
#endif #endif
#else #else
#define X86_64_ONLY(x) NULL #define X86_64_ONLY(x) NULL
#define X86_64_DEF(x...) #define X86_64_DEF(...)
#define CODE64(s) 0 #define CODE64(s) 0
#define REX_X(s) 0 #define REX_X(s) 0
#define REX_B(s) 0 #define REX_B(s) 0

View File

@ -501,13 +501,13 @@ static const char *fregnames[] =
"f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", }; "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", };
#ifdef MIPS_DEBUG_DISAS #ifdef MIPS_DEBUG_DISAS
#define MIPS_DEBUG(fmt, args...) \ #define MIPS_DEBUG(fmt, ...) \
qemu_log_mask(CPU_LOG_TB_IN_ASM, \ qemu_log_mask(CPU_LOG_TB_IN_ASM, \
TARGET_FMT_lx ": %08x " fmt "\n", \ 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__) #define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
#else #else
#define MIPS_DEBUG(fmt, args...) do { } while(0) #define MIPS_DEBUG(fmt, ...) do { } while(0)
#define LOG_DISAS(...) do { } while (0) #define LOG_DISAS(...) do { } while (0)
#endif #endif

View File

@ -13,22 +13,22 @@
//#define DEBUG_PCALL //#define DEBUG_PCALL
#ifdef DEBUG_MMU #ifdef DEBUG_MMU
#define DPRINTF_MMU(fmt, args...) \ #define DPRINTF_MMU(fmt, ...) \
do { printf("MMU: " fmt , ##args); } while (0) do { printf("MMU: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF_MMU(fmt, args...) do {} while (0) #define DPRINTF_MMU(fmt, ...) do {} while (0)
#endif #endif
#ifdef DEBUG_MXCC #ifdef DEBUG_MXCC
#define DPRINTF_MXCC(fmt, args...) \ #define DPRINTF_MXCC(fmt, ...) \
do { printf("MXCC: " fmt , ##args); } while (0) do { printf("MXCC: " fmt , ## __VA_ARGS__); } while (0)
#else #else
#define DPRINTF_MXCC(fmt, args...) do {} while (0) #define DPRINTF_MXCC(fmt, ...) do {} while (0)
#endif #endif
#ifdef DEBUG_ASI #ifdef DEBUG_ASI
#define DPRINTF_ASI(fmt, args...) \ #define DPRINTF_ASI(fmt, ...) \
do { printf("ASI: " fmt , ##args); } while (0) do { printf("ASI: " fmt , ## __VA_ARGS__); } while (0)
#endif #endif
#ifdef TARGET_SPARC64 #ifdef TARGET_SPARC64

View File

@ -65,7 +65,7 @@ int __chk_error(const char *filename, int line, int ret)
return 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)) #define chk_error(ret) __chk_error(__FILE__, __LINE__, (ret))