summaryrefslogtreecommitdiff
path: root/compiler.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-17 13:53:14 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-17 13:53:14 -0700
commitb8af9aa522935e7c261e8b4464dd2f4d0c972a14 (patch)
treef37823084167eef2f01238e658e6d4be05fdadc0 /compiler.h
parent2ced2ec3709d8cbcbb80d51f23092af260258cd1 (diff)
downloadnasm-b8af9aa522935e7c261e8b4464dd2f4d0c972a14.tar.gz
nasm-b8af9aa522935e7c261e8b4464dd2f4d0c972a14.tar.bz2
nasm-b8af9aa522935e7c261e8b4464dd2f4d0c972a14.zip
Cleaner way to handle MSVC's _snprintf() underscore damage
Some versions of MSVC have snprintf() and vsnprintf() only with a leading underscore. Handle that a bit more cleanly.
Diffstat (limited to 'compiler.h')
-rw-r--r--compiler.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler.h b/compiler.h
index b3f77c9..8ceb9ee 100644
--- a/compiler.h
+++ b/compiler.h
@@ -37,4 +37,14 @@
# define _unused
#endif
+/* Some versions of MSVC have these only with underscores in front */
+
+#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
+# define snprintf _snprintf
+#endif
+
+#if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
+# define vsnprintf _vsnprintf
+#endif
+
#endif /* COMPILER_H */