summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/stringutils.h13
-rw-r--r--src/utils/xml/libxml.cpp9
2 files changed, 5 insertions, 17 deletions
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index b5eca16ab..6d33c3830 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -100,15 +100,10 @@ const char *ipToString(const uint32_t address) A_WARN_UNUSED;
/**
* A safe version of sprintf that returns a std::string of the result.
*/
-std::string strprintf(const char *const format, ...) A_NONNULL(1) A_WARN_UNUSED
-#ifdef __GNUC__
-#ifdef __OpenBSD__
- __attribute__((__format__(printf, 1, 2)))
-#else // __OpenBSD__
- __attribute__((__format__(gnu_printf, 1, 2)))
-#endif // __OpenBSD__
-#endif // __GNUC__
-;
+std::string strprintf(const char *const format, ...)
+ A_NONNULL(1)
+ A_WARN_UNUSED
+ A_FORMAT_PRINTF(false, 1, 2);
/**
* Removes colors from a string
diff --git a/src/utils/xml/libxml.cpp b/src/utils/xml/libxml.cpp
index cc49a6012..97d2db58c 100644
--- a/src/utils/xml/libxml.cpp
+++ b/src/utils/xml/libxml.cpp
@@ -44,14 +44,7 @@ namespace
} // namespace
static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg A_UNUSED, ...)
-#ifdef __GNUC__
-#ifdef __OpenBSD__
- __attribute__((__format__(printf, 2, 3)))
-#else // __OpenBSD__
- __attribute__((__format__(gnu_printf, 2, 3)))
-#endif // __OpenBSD__
-#endif // __GNUC__
-;
+ A_FORMAT_PRINTF(false, 2, 3);
static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg, ...)
{