summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/zunitc/src/zuc_junit_reporter.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/zunitc/src/zuc_junit_reporter.c b/tools/zunitc/src/zuc_junit_reporter.c
index 369f0354..5c6b7627 100644
--- a/tools/zunitc/src/zuc_junit_reporter.c
+++ b/tools/zunitc/src/zuc_junit_reporter.c
@@ -53,6 +53,12 @@
#define ISO_8601_FORMAT "%Y-%m-%dT%H:%M:%SZ"
+#if LIBXML_VERSION >= 20904
+#define STRPRINTF_CAST
+#else
+#define STRPRINTF_CAST BAD_CAST
+#endif
+
/**
* Internal data.
*/
@@ -68,7 +74,7 @@ static void
set_attribute(xmlNodePtr node, const char *name, int value)
{
xmlChar scratch[MAX_64BIT_STRLEN + 1] = {};
- xmlStrPrintf(scratch, sizeof(scratch), BAD_CAST "%d", value);
+ xmlStrPrintf(scratch, sizeof(scratch), STRPRINTF_CAST "%d", value);
xmlSetProp(node, BAD_CAST name, scratch);
}