... and use it all over the place
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/error.h | 2 +-
src/iptraf-ng-compat.h | 12 ++++++------
src/tui/msgboxes.h | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/error.h b/src/error.h
index 7881c41..73dbb29 100644
--- a/src/error.h
+++ b/src/error.h
@@ -1,6 +1,6 @@
#ifndef IPTRAF_NG_ERROR_H
#define IPTRAF_NG_ERROR_H
-void write_error(char *msg, ...) __attribute__((format (printf, 1, 2)));
+void write_error(char *msg, ...) __printf(1,2);
#endif /* IPTRAF_NG_ERROR_H */
diff --git a/src/iptraf-ng-compat.h b/src/iptraf-ng-compat.h
index f055c82..8aa0be0 100644
--- a/src/iptraf-ng-compat.h
+++ b/src/iptraf-ng-compat.h
@@ -57,9 +57,9 @@
#define dispmode(mode) \
(((mode) == KBITS) ? "kbps": "kBps")
-#define __noreturn __attribute__((noreturn))
-#define __unused __attribute__((unused))
-#define __format __attribute__((format(printf, 1, 2)))
+#define __noreturn __attribute__((noreturn))
+#define __unused __attribute__((unused))
+#define __printf(x, y) __attribute__((format(printf, (x), (y))))
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -95,9 +95,9 @@ extern char *xstrdup(const char *s);
extern int strtoul_ui(char const *s, int base, unsigned int *result);
extern int strtol_i(char const *s, int base, int *result);
-extern void die(const char *err, ...) __format __noreturn;
-extern void die_errno(const char *fmt, ...) __format __noreturn;
-extern void error(const char *err, ...) __format;
+extern void die(const char *err, ...) __noreturn __printf(1,2);
+extern void die_errno(const char *fmt, ...) __noreturn __printf(1,2);
+extern void error(const char *err, ...) __printf(1,2);
static inline char *skip_whitespace(char *str)
{
diff --git a/src/tui/msgboxes.h b/src/tui/msgboxes.h
index 9758411..69336fe 100644
--- a/src/tui/msgboxes.h
+++ b/src/tui/msgboxes.h
@@ -6,7 +6,7 @@
void tx_init_error_attrs(int border, int text, int prompt);
void tx_init_info_attrs(int border, int text, int prompt);
void tx_infobox(char *text, char *prompt);
-void tui_error(const char *prompt, const char *err, ...) __attribute((format (printf, 2,
3)));
+void tui_error(const char *prompt, const char *err, ...) __printf(2,3);
void tui_error_va(const char *prompt, const char *err, va_list vararg);
#endif /* IPTRAF_NG_TUI_MSGBOXES_H */
--
1.7.8.4