mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Replace gcc variadic macro extension with C99 version
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
+3
-3
@@ -73,10 +73,10 @@
|
||||
|
||||
//#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 */
|
||||
|
||||
+6
-6
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
//#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 */
|
||||
|
||||
+3
-3
@@ -33,10 +33,10 @@
|
||||
//#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;
|
||||
|
||||
+3
-3
@@ -14,10 +14,10 @@
|
||||
//#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
|
||||
|
||||
+3
-3
@@ -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)
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
//#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 */
|
||||
|
||||
+5
-5
@@ -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
|
||||
|
||||
+3
-3
@@ -28,10 +28,10 @@
|
||||
//#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:
|
||||
|
||||
+2
-2
@@ -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. */
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
@@ -62,22 +62,22 @@
|
||||
*/
|
||||
|
||||
#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 {
|
||||
|
||||
@@ -38,14 +38,14 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
@@ -37,14 +37,14 @@
|
||||
//#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 */
|
||||
|
||||
+3
-3
@@ -30,10 +30,10 @@
|
||||
//#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
|
||||
|
||||
+5
-5
@@ -26,13 +26,13 @@
|
||||
//#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 */
|
||||
|
||||
+3
-3
@@ -31,10 +31,10 @@
|
||||
//#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;
|
||||
|
||||
+3
-3
@@ -29,10 +29,10 @@
|
||||
//#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 {
|
||||
|
||||
+3
-3
@@ -28,10 +28,10 @@
|
||||
//#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)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user