Skip to contentSkip to conversation

rtl8139: Fix compilation for w32/w64

PATCH Applied Stefan Weil 2 participants 2 messages Apr 26, 2011 – Apr 27, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtl8139: Fix compilation for w32/w64

Compilation for Windows needs a different declaration for the printf format attribute, so use the macro which was defined for this purpose.

Cc Benjamin Poirier <[email protected]>
---
 hw/rtl8139.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
hw/rtl8139.c +1 -2
index 623fb0c..b997fe7 100644
@@ -88,8 +88,7 @@
 #  define DPRINTF(fmt, ...) \
     do { fprintf(stderr, "RTL8139: " fmt, ## __VA_ARGS__); } while (0)
 #else
-static inline __attribute__ ((format (printf, 1, 2)))
-    int DPRINTF(const char *fmt, ...)
+static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...)
 {
     return 0;
 }
Signature · 1 line
1.7.2.5
#1 lore raw
Quoted 9 lines · Stefan Weil

Compilation for Windows needs a different declaration for the printf format attribute, so use the macro which was defined for this purpose.

Cc Benjamin Poirier <[email protected]>
---
 hw/rtl8139.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Thanks, applied.

Quoted 18 lines
hw/rtl8139.c +1 -2
index 623fb0c..b997fe7 100644
@@ -88,8 +88,7 @@
 #  define DPRINTF(fmt, ...) \
     do { fprintf(stderr, "RTL8139: " fmt, ## __VA_ARGS__); } while (0)
 #else
-static inline __attribute__ ((format (printf, 1, 2)))
-    int DPRINTF(const char *fmt, ...)
+static inline GCC_FMT_ATTR(1, 2) int DPRINTF(const char *fmt, ...)
 {
     return 0;
 }
Signature · 1 line
1.7.2.5
Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net