summaryrefslogtreecommitdiff
path: root/tests/check_aec.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/check_aec.h')
-rw-r--r--tests/check_aec.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/check_aec.h b/tests/check_aec.h
index 02c3e77..2f6abd3 100644
--- a/tests/check_aec.h
+++ b/tests/check_aec.h
@@ -1,5 +1,7 @@
#ifndef CHECK_AEC_H
#define CHECK_AEC_H 1
+
+#include <config.h>
#include "libaec.h"
struct test_state {
@@ -24,6 +26,18 @@ int update_state(struct test_state *state);
int encode_decode_small(struct test_state *state);
int encode_decode_large(struct test_state *state);
+#ifndef HAVE_SNPRINTF
+#ifdef HAVE__SNPRINTF_S
+#define snprintf(d, n, ...) _snprintf_s((d), (n), _TRUNCATE, __VA_ARGS__)
+#else
+#ifdef HAVE__SNPRINTF
+#define snprintf _snprintf
+#else
+#error "no snprintf compatible function found"
+#endif /* HAVE__SNPRINTF */
+#endif /* HAVE__SNPRINTF_S */
+#endif /* HAVE_SNPRINTF */
+
#ifdef _WIN32
#define CHECK_PASS "PASS"
#define CHECK_FAIL "FAIL"