diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2017-02-04 16:27:20 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2017-02-04 16:27:20 +0000 |
commit | 0838b4d3d9bc59c4b6323222c42e367d50c9f4cc (patch) | |
tree | 3d0e3decd126fc262fa0757d225847363bd7e6e4 | |
parent | 29c7e3972fc35eda9aba49c957149ce22824c322 (diff) | |
download | pcre2-0838b4d3d9bc59c4b6323222c42e367d50c9f4cc.tar.gz |
Don't use %td (use %lu instead) in pcre2test under MSVC.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@658 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/pcre2test.c | 17 |
2 files changed, 17 insertions, 8 deletions
@@ -219,6 +219,8 @@ compliant and unique. wrong name. 27. In pcre2test, give some offset information for errors in hex patterns. +This uses the C99 formatting sequence %td, except for MSVC which doesn't +support it - %lu is used instead. 28. Implemented pcre2_code_copy_with_tables(), and added pushtablescopy to pcre2test for testing it. @@ -329,13 +331,13 @@ JIT. AC_USE_SYSTEM_EXTENSIONS macro and to test for functions used by the JIT modules. -52. Minor fixed to pcre2grep from Jason Hood: +52. Minor fixes to pcre2grep from Jason Hood: * fixed some spacing; * Windows doesn't usually use single quotes, so I've added a define to use appropriate quotes [in an example]; * LC_ALL was displayed as "LCC_ALL"; - * numbers 11, 12 & 13 should end in "th". - * use double quotes in usage message + * numbers 11, 12 & 13 should end in "th"; + * use double quotes in usage message. Version 10.22 29-July-2016 diff --git a/src/pcre2test.c b/src/pcre2test.c index e1c8d25..241c22c 100644 --- a/src/pcre2test.c +++ b/src/pcre2test.c @@ -158,6 +158,13 @@ patterns. */ void vms_setsymbol( char *, char *, int ); #endif +/* VC doesn't support "%td". */ +#ifdef _MSC_VER +#define PTR_SPEC "%lu" +#else +#define PTR_SPEC "%td" +#endif + /* ------------------End of system-specific definitions -------------------- */ /* Glueing macros that are used in several places below. */ @@ -4663,7 +4670,7 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0) if (d == 0) { fprintf(outfile, "** Missing closing quote in hex pattern: " - "opening quote is at offset %td.\n", pq - buffer - 2); + "opening quote is at offset " PTR_SPEC ".\n", pq - buffer - 2); return PR_SKIP; } if (d == c) break; @@ -4677,8 +4684,8 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0) { if (!isxdigit(c)) { - fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset %td " - "in hex pattern: quote missing?\n", c, pp - buffer - 2); + fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset " + PTR_SPEC " in hex pattern: quote missing?\n", c, pp - buffer - 2); return PR_SKIP; } if (*pp == 0) @@ -4689,8 +4696,8 @@ if ((pat_patctl.control & CTL_HEXPAT) != 0) d = *pp; if (!isxdigit(d)) { - fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset %td " - "in hex pattern: quote missing?\n", d, pp - buffer - 1); + fprintf(outfile, "** Unexpected non-hex-digit '%c' at offset " + PTR_SPEC " in hex pattern: quote missing?\n", d, pp - buffer - 1); return PR_SKIP; } c = toupper(c); |