summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-10-15 18:40:39 -0400
committerKeith Bostic <keith@wiredtiger.com>2014-10-15 18:40:39 -0400
commit2fb71dc122963f399436892ea432a9674b6159d9 (patch)
treea07506a945c56a107e22f316602bcc33df896676 /test
parent6603c1a45526db975372d9e28b9a65c3deac7e98 (diff)
downloadmongo-2fb71dc122963f399436892ea432a9674b6159d9.tar.gz
MSVC doesn't yet support "%zu", replace with #defines.
Diffstat (limited to 'test')
-rw-r--r--test/format/format.h6
-rw-r--r--test/format/salvage.c2
-rw-r--r--test/huge/huge.c8
3 files changed, 14 insertions, 2 deletions
diff --git a/test/format/format.h b/test/format/format.h
index 01fbad98af4..f92ecaa7cad 100644
--- a/test/format/format.h
+++ b/test/format/format.h
@@ -84,6 +84,12 @@ extern WT_EXTENSION_API *wt_api;
#define DATASOURCE(v) (strcmp(v, g.c_data_source) == 0 ? 1 : 0)
#define SINGLETHREADED (g.c_threads == 1)
+#ifndef _WIN32
+#define SIZET_FMT "%zu" /* size_t format string */
+#else
+#define SIZET_FMT "%Iu" /* size_t format string */
+#endif
+
typedef struct {
char *progname; /* Program name */
diff --git a/test/format/salvage.c b/test/format/salvage.c
index 9fccf880a68..59682dea10e 100644
--- a/test/format/salvage.c
+++ b/test/format/salvage.c
@@ -96,7 +96,7 @@ found: if (fstat(fd, &sb) == -1)
if ((fp = fopen(buf, "w")) == NULL)
die(errno, "salvage-corrupt: open: %s", buf);
(void)fprintf(fp,
- "salvage-corrupt: offset %" PRIuMAX ", length %zu\n",
+ "salvage-corrupt: offset %" PRIuMAX ", length " SIZET_FMT "\n",
(uintmax_t)offset, len);
(void)fclose(fp);
diff --git a/test/huge/huge.c b/test/huge/huge.c
index aadcfe879bd..810c70b2606 100644
--- a/test/huge/huge.c
+++ b/test/huge/huge.c
@@ -96,6 +96,12 @@ die(int e, const char *fmt, ...)
exit(EXIT_FAILURE);
}
+#ifndef _WIN32
+#define SIZET_FMT "%zu" /* size_t format string */
+#else
+#define SIZET_FMT "%Iu" /* size_t format string */
+#endif
+
static void
run(CONFIG *cp, int bigkey, size_t bytes)
{
@@ -108,7 +114,7 @@ run(CONFIG *cp, int bigkey, size_t bytes)
big[bytes - 1] = '\0';
- printf("%zu" "%s%s: %s %s big %s\n",
+ printf(SIZET_FMT "%s%s: %s %s big %s\n",
bytes < MEGABYTE ? bytes :
(bytes < GIGABYTE ? bytes / MEGABYTE : bytes / GIGABYTE),
bytes < MEGABYTE ? "" :