diff options
author | Brad King <brad.king@kitware.com> | 2022-06-14 16:04:53 +0000 |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-06-14 12:05:08 -0400 |
commit | 6b5a0a0685b0e0a669bf261459924896e738930c (patch) | |
tree | 97fc539da73285a6c16731a186b3266610edf6f0 /Utilities | |
parent | 18687760f49dbffceb191c9a3955156215f86ab8 (diff) | |
parent | 82eb51263771341645f80fdcea36ff6a510144bb (diff) | |
download | cmake-6b5a0a0685b0e0a669bf261459924896e738930c.tar.gz |
Merge topic 'update-kwiml' into release-3.24
82eb512637 Merge branch 'upstream-KWIML' into update-kwiml
2a233bb754 KWIML 2022-06-14 (7b9bd7fe)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !7356
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/KWIML/test/test_int_format.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Utilities/KWIML/test/test_int_format.h b/Utilities/KWIML/test/test_int_format.h index 2e0310ce4e..e139bdb16e 100644 --- a/Utilities/KWIML/test/test_int_format.h +++ b/Utilities/KWIML/test/test_int_format.h @@ -24,6 +24,12 @@ # define STATIC_CAST(t,v) (t)(v) #endif +#if defined(_MSC_VER) && _MSC_VER < 1900 +# define SNPRINTF(buf, sz, fmt, x) sprintf(buf, fmt, x) +#else +# define SNPRINTF(buf, sz, fmt, x) snprintf(buf, sz, fmt, x) +#endif + #define VALUE(T, U) STATIC_CAST(T, STATIC_CAST(U, 0xab) << ((sizeof(T)-1)<<3)) #define TEST_C_(C, V, PRI, T, U) \ @@ -48,7 +54,7 @@ { \ T const x = VALUE(T, U); \ char const* str = STR; \ - sprintf(buf, "%" KWIML_INT_PRI##PRI, x); \ + SNPRINTF(buf, sizeof(buf), "%" KWIML_INT_PRI##PRI, x); \ printf(LANG "KWIML_INT_PRI" #PRI ":" \ " expected [%s], got [%s]", str, buf); \ if(strcmp(str, buf) == 0) \ |