@@ -31,13 +31,16 @@
/* debug ADB */
//#define DEBUG_ADB
-
-#ifdef DEBUG_ADB
-#define ADB_DPRINTF(fmt, ...) \
-do { printf("ADB: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define ADB_DPRINTF(fmt, ...)
-#endif
+#ifndef DEBUG_ADB
+#define DEBUG_ADB 0
+#endif
+
+#define ADB_DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_ADB) { \
+ fprintf(stderr, "ADB: " fmt , ## __VA_ARGS__); \
+ } \
+ } while (0)
/* ADB commands */
#define ADB_BUSRESET 0x00
@@ -30,12 +30,17 @@
/* debug PC keyboard */
//#define DEBUG_KBD
-#ifdef DEBUG_KBD
-#define DPRINTF(fmt, ...) \
- do { printf("KBD: " fmt , ## __VA_ARGS__); } while (0)
-#else
-#define DPRINTF(fmt, ...)
-#endif
+
+#ifndef DEBUG_KBD
+#define DEBUG_KBD 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_KBD) { \
+ fprintf(stderr, "KDB: " fmt , ## __VA_ARGS__); \
+ } \
+ } while (0)
/* Keyboard Controller Commands */
#define KBD_CCMD_READ_MODE 0x20 /* Read mode bits */
@@ -46,11 +46,16 @@
#define VMMOUSE_VERSION 0x3442554a
-#ifdef DEBUG_VMMOUSE
-#define DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__)
-#else
-#define DPRINTF(fmt, ...) do { } while (0)
-#endif
+#ifndef DEBUG_VMMOUSE
+#define DEBUG_VMMOUSE 0
+#endif
+
+#define DPRINTF(fmt, ...) \
+ do { \
+ if (DEBUG_VMMOUSE) { \
+ fprintf(stderr, fmt, ## __VA_ARGS__); \
+ } \
+ } while (0)
#define TYPE_VMMOUSE "vmmouse"
#define VMMOUSE(obj) OBJECT_CHECK(VMMouseState, (obj), TYPE_VMMOUSE)