[exim-cvs] PCRE_PRERELEASE fix, again

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] PCRE_PRERELEASE fix, again
Gitweb: http://git.exim.org/exim.git/commitdiff/6475bd82de30cfbb2b0897a05d1200674aa88f4f
Commit:     6475bd82de30cfbb2b0897a05d1200674aa88f4f
Parent:     f90a9fd133ac62eb3fa1e834b3bff16360d23500
Author:     Phil Pennock <pdp@???>
AuthorDate: Sat May 19 17:59:09 2012 -0400
Committer:  Phil Pennock <pdp@???>
CommitDate: Sat May 19 17:59:09 2012 -0400


    PCRE_PRERELEASE fix, again
---
 doc/doc-txt/ChangeLog |    2 ++
 src/src/exim.c        |   21 +++++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 08fd2ef..620d871 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -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
 -----------------
diff --git a/src/src/exim.c b/src/src/exim.c
index 720d228..af01d40 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -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++)