aboutsummaryrefslogtreecommitdiff
path: root/tjutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'tjutil.h')
-rw-r--r--tjutil.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/tjutil.h b/tjutil.h
index 8542bab9..10272e98 100644
--- a/tjutil.h
+++ b/tjutil.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C)2011 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2011, 2022 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -27,14 +27,20 @@
*/
#ifdef _WIN32
-#ifndef __MINGW32__
-#include <stdio.h>
-#define snprintf(str, n, format, ...) \
- _snprintf_s(str, n, _TRUNCATE, format, ##__VA_ARGS__)
-#endif
+#ifndef strcasecmp
#define strcasecmp stricmp
+#endif
+#ifndef strncasecmp
#define strncasecmp strnicmp
#endif
+#endif
+
+#ifdef _MSC_VER
+#define SNPRINTF(str, n, format, ...) \
+ _snprintf_s(str, n, _TRUNCATE, format, ##__VA_ARGS__)
+#else
+#define SNPRINTF snprintf
+#endif
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))