summaryrefslogtreecommitdiff
path: root/test/windows
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2014-12-17 14:11:41 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2014-12-17 17:44:07 -0500
commit235f747e2df80d9899497595a2b649e7d6df8601 (patch)
treeedea3ec0cd87c65e0175a4478dc5d1c334d1b643 /test/windows
parent2baf19b28b5b7a7468f376da90da328ad0ac0117 (diff)
downloadmongo-235f747e2df80d9899497595a2b649e7d6df8601.tar.gz
snprintf - Implement a custom version of snprintf match the
truncation behavior of C99 standard snprintf until MSVC supports snprintf.
Diffstat (limited to 'test/windows')
-rw-r--r--test/windows/windows_shim.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/windows/windows_shim.h b/test/windows/windows_shim.h
index 3b09fdc6b2a..47a1018c229 100644
--- a/test/windows/windows_shim.h
+++ b/test/windows/windows_shim.h
@@ -43,7 +43,14 @@ typedef int u_int;
#define X_OK R_OK
/* snprintf does not exist on <= VS 2013 */
-#define snprintf _snprintf
+#if _MSC_VER < 1900
+#define snprintf _wt_snprintf
+
+_Check_return_opt_ int __cdecl _wt_snprintf(
+ _Out_writes_(_MaxCount) char * _DstBuf,
+ _In_ size_t _MaxCount,
+ _In_z_ _Printf_format_string_ const char * _Format, ...);
+#endif
/*
* Emulate <sys/stat.h>