PCRE_PRERELEASE fix, again
authorPhil Pennock <pdp@exim.org>
Sat, 19 May 2012 21:59:09 +0000 (17:59 -0400)
committerPhil Pennock <pdp@exim.org>
Sat, 19 May 2012 21:59:09 +0000 (17:59 -0400)
doc/doc-txt/ChangeLog
src/src/exim.c

index 08fd2efe5984c69cdfa1da4a6e82ddf47e922fd9..620d871143742c696e204eea8fe188a1e7b22293 100644 (file)
@@ -127,6 +127,8 @@ PP/29 Fix three issues highlighted by clang analyser static analysis.
       iplookup router and a misconfiguration.
       Report from Marcin MirosÅ‚aw.
 
+PP/30 Another attempt to deal with PCRE_PRERELEASE, this one less buggy.
+
 
 Exim version 4.77
 -----------------
index 720d2283c6624e92ff243380e53abe07f2671c0e..af01d40d468fef80f9d7718d0a401db8cfe2a6c0 100644 (file)
@@ -976,20 +976,21 @@ DEBUG(D_any) do {
     }
   }
 
+  /* PRE_PRERELEASE is either defined and empty or a bare sequence of
+  characters; unless it's an ancient version of PCRE in which case it
+  is not defined. */
+#ifndef PCRE_PRERELEASE
+#define PCRE_PRERELEASE
+#endif
+#define QUOTE(X) #X
+#define EXPAND_AND_QUOTE(X) QUOTE(X)
   fprintf(f, "Library version: PCRE: Compile: %d.%d%s\n"
              "                       Runtime: %s\n",
           PCRE_MAJOR, PCRE_MINOR,
-          /* PRE_PRERELEASE is either defined and empty or a string.
-           * unless its an ancient version of PCRE in which case it
-           * is not defined */
-#ifdef PCRE_PRERELEASE
-# define STRINGIFY(x) #x
-          STRINGIFY(PCRE_PRERELEASE) "",
-# undef STRINGIFY
-#else
-          "",
-#endif
+          EXPAND_AND_QUOTE(PCRE_PRERELEASE) "",
           pcre_version());
+#undef QUOTE
+#undef EXPAND_AND_QUOTE
 
   init_lookup_list();
   for (i = 0; i < lookup_list_count; i++)