diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-03-16 20:00:56 -0400 |
---|---|---|
committer | Keith Bostic <keith.bostic@mongodb.com> | 2016-03-16 20:00:56 -0400 |
commit | 83bb8a3c49507d5b4d89d6b467b654338a98f564 (patch) | |
tree | 1e834926414726d31a598dc6ae7ebe3936961e9a | |
parent | 69f40aeb87c0b91a0356e277c5cdcbe4ec152d5c (diff) | |
parent | be18e7cf192c5ef7a6b782370a3765a0883a5186 (diff) | |
download | mongo-83bb8a3c49507d5b4d89d6b467b654338a98f564.tar.gz |
Merge pull request #2591 from wiredtiger/wt-2492
WT-2492 Change printf format specifier to be Windows compatible.
-rw-r--r-- | dist/s_string.ok | 1 | ||||
-rw-r--r-- | src/config/config.c | 9 | ||||
-rw-r--r-- | src/include/gcc.h | 1 | ||||
-rw-r--r-- | src/include/lint.h | 1 | ||||
-rw-r--r-- | src/include/msvc.h | 1 |
5 files changed, 7 insertions, 6 deletions
diff --git a/dist/s_string.ok b/dist/s_string.ok index 43eb7861b23..6762521ca76 100644 --- a/dist/s_string.ok +++ b/dist/s_string.ok @@ -878,6 +878,7 @@ ps psp pthread ptr +ptrdiff pushms putK putV diff --git a/src/config/config.c b/src/config/config.c index 9d14353f730..96ef7a4e62a 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -15,13 +15,10 @@ static int __config_err(WT_CONFIG *conf, const char *msg, int err) { - ptrdiff_t d; - - d = conf->cur - conf->orig; - WT_RET_MSG(conf->session, err, - "Error parsing '%.*s' at offset %td: %s", - (int)(conf->end - conf->orig), conf->orig, d, msg); + "Error parsing '%.*s' at offset %" WT_PTRDIFFT_FMT ": %s", + (int)(conf->end - conf->orig), conf->orig, + conf->cur - conf->orig, msg); } /* diff --git a/src/include/gcc.h b/src/include/gcc.h index 6ccc0de3c03..ce6afdd6e9c 100644 --- a/src/include/gcc.h +++ b/src/include/gcc.h @@ -6,6 +6,7 @@ * See the file LICENSE for redistribution information. */ +#define WT_PTRDIFFT_FMT "td" /* ptrdiff_t format string */ #define WT_SIZET_FMT "zu" /* size_t format string */ /* Add GCC-specific attributes to types and function declarations. */ diff --git a/src/include/lint.h b/src/include/lint.h index f8b17022968..1b64186cbab 100644 --- a/src/include/lint.h +++ b/src/include/lint.h @@ -6,6 +6,7 @@ * See the file LICENSE for redistribution information. */ +#define WT_PTRDIFFT_FMT "td" /* ptrdiff_t format string */ #define WT_SIZET_FMT "zu" /* size_t format string */ #define WT_COMPILER_TYPE_ALIGN(x) diff --git a/src/include/msvc.h b/src/include/msvc.h index 99260a44875..d5be5bd8c60 100644 --- a/src/include/msvc.h +++ b/src/include/msvc.h @@ -13,6 +13,7 @@ #define inline __inline +#define WT_PTRDIFFT_FMT "Id" /* ptrdiff_t format string */ #define WT_SIZET_FMT "Iu" /* size_t format string */ /* |