summaryrefslogtreecommitdiff
path: root/include/share/compat.h
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2013-03-17 20:51:52 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2013-03-17 20:52:04 +1100
commit06af237c7008086a5389871320e5669dd51a0fdc (patch)
tree5be91b7126cec1cc89560ef254868d012fda74aa /include/share/compat.h
parent248d7924b711bd093bc2d7c5c2ac0265ed934d33 (diff)
downloadflac-06af237c7008086a5389871320e5669dd51a0fdc.tar.gz
Add file src/share/grabbag/snprintf.c to grabbag library.
Define function flac_snprintf() which has ISO C99 snprintf() behavior even when compiling with Microsoft Visual Studio, by wrapping the MSVS snprintf_s() function.
Diffstat (limited to 'include/share/compat.h')
-rw-r--r--include/share/compat.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/share/compat.h b/include/share/compat.h
index 9c3d35e7..ee4c3e50 100644
--- a/include/share/compat.h
+++ b/include/share/compat.h
@@ -143,4 +143,14 @@
# endif
#endif /* defined _MSC_VER */
+
+/* FLAC needs to compile and work correctly on systems with a norrmal ISO C99
+ * snprintf as well as Microsoft Visual Studio which has an non-standards
+ * conformant snprint_s function.
+ *
+ * This function wraps the MS version to behave more like the the ISO version.
+ */
+
+int flac_snprintf(char *str, size_t size, const char *fmt, ...);
+
#endif /* FLAC__SHARE__COMPAT_H */