diff -Naur pcre-7.9/pcre_compile.c pcre_sug/pcre_compile.c
--- pcre-7.9/pcre_compile.c	2009-10-19 17:25:56.000000000 +0200
+++ pcre_sug/pcre_compile.c	2009-10-19 17:22:30.000000000 +0200
@@ -53,10 +53,10 @@
 #include "pcre_internal.h"
 
 
-/* When DEBUG is defined, we need the pcre_printint() function, which is also
-used by pcretest. DEBUG is not defined when building a production library. */
+/* When PCRE_DEBUG is defined, we need the pcre_printint() function, which is also
+used by pcretest. PCRE_DEBUG is not defined when building a production library. */
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
 #include "pcre_printint.src"
 #endif
 
@@ -1948,9 +1948,9 @@
 could_be_empty(const uschar *code, const uschar *endcode, branch_chain *bcptr,
   BOOL utf8)
 {
-while (bcptr != NULL && bcptr->current >= code)
+while (bcptr != NULL && bcptr->current_b >= code)
   {
-  if (!could_be_empty_branch(bcptr->current, endcode, utf8)) return FALSE;
+  if (!could_be_empty_branch(bcptr->current_b, endcode, utf8)) return FALSE;
   bcptr = bcptr->outer;
   }
 return TRUE;
@@ -2612,7 +2612,7 @@
 uschar *utf8_char = NULL;
 #endif
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
 if (lengthptr != NULL) DPRINTF((">> start branch\n"));
 #endif
 
@@ -2671,7 +2671,7 @@
 
   if (lengthptr != NULL)
     {
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
     if (code > cd->hwm) cd->hwm = code;                 /* High water info */
 #endif
     if (code > cd->start_workspace + COMPILE_WORK_SIZE) /* Check for overrun */
@@ -4162,8 +4162,8 @@
           if (lengthptr != NULL)
             {
             int delta = (repeat_min - 1)*length_prevgroup;
-            if ((double)(repeat_min - 1)*(double)length_prevgroup >
-                                                            (double)INT_MAX ||
+            if ((int64_t)(repeat_min - 1)*(int64_t)length_prevgroup >
+                                                            (int64_t)INT_MAX ||
                 OFLOW_MAX - *lengthptr < delta)
               {
               *errorcodeptr = ERR20;
@@ -4215,9 +4215,9 @@
           {
           int delta = repeat_max * (length_prevgroup + 1 + 2 + 2*LINK_SIZE) -
                       2 - 2*LINK_SIZE;   /* Last one doesn't nest */
-          if ((double)repeat_max *
-                (double)(length_prevgroup + 1 + 2 + 2*LINK_SIZE)
-                  > (double)INT_MAX ||
+          if ((int64_t)repeat_max *
+                (int64_t)(length_prevgroup + 1 + 2 + 2*LINK_SIZE)
+                  > (int64_t)INT_MAX ||
               OFLOW_MAX - *lengthptr < delta)
             {
             *errorcodeptr = ERR20;
@@ -5656,7 +5656,7 @@
 branch_chain bc;
 
 bc.outer = bcptr;
-bc.current = code;
+bc.current_b = code;
 
 firstbyte = reqbyte = REQ_UNSET;
 
@@ -5865,7 +5865,7 @@
     {
     *code = OP_ALT;
     PUT(code, 1, code - last_branch);
-    bc.current = last_branch = code;
+    bc.current_b = last_branch = code;
     code += 1 + LINK_SIZE;
     }
 
@@ -6476,7 +6476,7 @@
 
 *code++ = OP_END;
 
-#ifndef DEBUG
+#ifndef PCRE_DEBUG
 if (code - codestart > length) errorcode = ERR23;
 #endif
 
@@ -6559,7 +6559,7 @@
 /* Print out the compiled data if debugging is enabled. This is never the
 case when building a production library. */
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
 
 printf("Length = %d top_bracket = %d top_backref = %d\n",
   length, re->top_bracket, re->top_backref);
@@ -6597,7 +6597,7 @@
   if (errorcodeptr != NULL) *errorcodeptr = ERR23;
   return NULL;
   }
-#endif   /* DEBUG */
+#endif   /* PCRE_DEBUG */
 
 return (pcre *)re;
 }
diff -Naur pcre-7.9/pcre_dfa_exec.c pcre_sug/pcre_dfa_exec.c
--- pcre-7.9/pcre_dfa_exec.c	2009-10-19 17:25:56.000000000 +0200
+++ pcre_sug/pcre_dfa_exec.c	2009-10-19 17:19:04.000000000 +0200
@@ -170,7 +170,7 @@
 #define INTS_PER_STATEBLOCK  (sizeof(stateblock)/sizeof(int))
 
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
 /*************************************************
 *             Print character string             *
 *************************************************/
@@ -467,7 +467,7 @@
   workspace[0] ^= 1;              /* Remember for the restarting feature */
   workspace[1] = active_count;
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
   printf("%.*sNext character: rest of subject = \"", rlevel*2-2, SP);
   pchars((uschar *)ptr, strlen((char *)ptr), stdout);
   printf("\"\n");
@@ -513,7 +513,7 @@
     int state_offset = current_state->offset;
     int count, codevalue, rrc;
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
     printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset);
     if (clen == 0) printf("EOL\n");
       else if (c > 32 && c < 127) printf("'%c'\n", c);
diff -Naur pcre-7.9/pcre_exec.c pcre_sug/pcre_exec.c
--- pcre-7.9/pcre_exec.c	2009-10-19 17:25:56.000000000 +0200
+++ pcre_sug/pcre_exec.c	2009-10-19 17:21:42.000000000 +0200
@@ -89,7 +89,7 @@
 
 
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
 /*************************************************
 *        Debugging function to print chars       *
 *************************************************/
@@ -141,7 +141,7 @@
 {
 USPTR p = md->start_subject + md->offset_vector[offset];
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
 if (eptr >= md->end_subject)
   printf("matching subject <null>");
 else
@@ -254,7 +254,7 @@
 #ifndef NO_RECURSE
 #define REGISTER register
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
 #define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \
   { \
   printf("match() called in line %d\n", __LINE__); \
@@ -600,7 +600,7 @@
 /* OK, now we can get on with the real code of the function. Recursive calls
 are specified by the macro RMATCH and RRETURN is used to return. When
 NO_RECURSE is *not* defined, these just turn into a recursive call to match()
-and a "return", respectively (possibly with some debugging if DEBUG is
+and a "return", respectively (possibly with some debugging if PCRE_DEBUG is
 defined). However, RMATCH isn't like a function call because it's quite a
 complicated macro. It has to be used in one particular way. This shouldn't,
 however, impact performance when true recursion is being used. */
@@ -699,7 +699,7 @@
     number = GET2(ecode, 1+LINK_SIZE);
     offset = number << 1;
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
     printf("start bracket %d\n", number);
     printf("subject=");
     pchars(eptr, 16, TRUE, md);
@@ -1290,7 +1290,7 @@
       number = GET2(prev, 1+LINK_SIZE);
       offset = number << 1;
 
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
       printf("end bracket %d", number);
       printf("\n");
 #endif
@@ -4822,7 +4822,7 @@
 
   end_subject = save_end_subject;
 
-#ifdef DEBUG  /* Sigh. Some compilers never learn. */
+#ifdef PCRE_DEBUG  /* Sigh. Some compilers never learn. */
   printf(">>>> Match against: ");
   pchars(start_match, end_subject - start_match, TRUE, md);
   printf("\n");
diff -Naur pcre-7.9/pcre_internal.h pcre_sug/pcre_internal.h
--- pcre-7.9/pcre_internal.h	2009-10-19 17:25:56.000000000 +0200
+++ pcre_sug/pcre_internal.h	2009-10-19 17:20:29.000000000 +0200
@@ -45,10 +45,10 @@
 #ifndef PCRE_INTERNAL_H
 #define PCRE_INTERNAL_H
 
-/* Define DEBUG to get debugging output on stdout. */
+/* Define PCRE_DEBUG to get debugging output on stdout. */
 
 #if 0
-#define DEBUG
+#define PCRE_DEBUG
 #endif
 
 /* We do not support both EBCDIC and UTF-8 at the same time. The "configure"
@@ -74,7 +74,7 @@
 be absolutely sure we get our version. */
 
 #undef DPRINTF
-#ifdef DEBUG
+#ifdef PCRE_DEBUG
 #define DPRINTF(p) printf p
 #else
 #define DPRINTF(p) /* Nothing */
@@ -86,8 +86,6 @@
 
 #include <ctype.h>
 #include <limits.h>
-#include <setjmp.h>
-#include <stdarg.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -1552,7 +1550,7 @@
 
 typedef struct branch_chain {
   struct branch_chain *outer;
-  uschar *current;
+  uschar *current_b;
 } branch_chain;
 
 /* Structure for items in a linked list that represents an explicit recursive
diff -Naur pcre-7.9/pcre_printint.src pcre_sug/pcre_printint.src
--- pcre-7.9/pcre_printint.src	2009-10-19 17:25:56.000000000 +0200
+++ pcre_sug/pcre_printint.src	2009-10-19 17:19:04.000000000 +0200
@@ -43,7 +43,7 @@
 local functions. This source file is used in two places:
 
 (1) It is #included by pcre_compile.c when it is compiled in debugging mode
-(DEBUG defined in pcre_internal.h). It is not included in production compiles.
+(PCRE_DEBUG defined in pcre_internal.h). It is not included in production compiles.
 
 (2) It is always #included by pcretest.c, which can be asked to print out a
 compiled regex for debugging purposes. */
diff -Naur pcre-7.9/pcre_study.c pcre_sug/pcre_study.c
--- pcre-7.9/pcre_study.c	2009-10-19 17:25:56.000000000 +0200
+++ pcre_sug/pcre_study.c	2009-10-19 17:19:04.000000000 +0200
@@ -71,7 +71,7 @@
 */
 
 static void
-set_bit(uschar *start_bits, unsigned int c, BOOL caseless, compile_data *cd)
+pcre_set_bit(uschar *start_bits, unsigned int c, BOOL caseless, compile_data *cd)
 {
 start_bits[c/8] |= (1 << (c&7));
 if (caseless && (cd->ctypes[c] & ctype_letter) != 0)
@@ -233,7 +233,7 @@
       case OP_QUERY:
       case OP_MINQUERY:
       case OP_POSQUERY:
-      set_bit(start_bits, tcode[1], caseless, cd);
+      pcre_set_bit(start_bits, tcode[1], caseless, cd);
       tcode += 2;
 #ifdef SUPPORT_UTF8
       if (utf8 && tcode[-1] >= 0xc0)
@@ -246,7 +246,7 @@
       case OP_UPTO:
       case OP_MINUPTO:
       case OP_POSUPTO:
-      set_bit(start_bits, tcode[3], caseless, cd);
+      pcre_set_bit(start_bits, tcode[3], caseless, cd);
       tcode += 4;
 #ifdef SUPPORT_UTF8
       if (utf8 && tcode[-1] >= 0xc0)
@@ -264,7 +264,7 @@
       case OP_PLUS:
       case OP_MINPLUS:
       case OP_POSPLUS:
-      set_bit(start_bits, tcode[1], caseless, cd);
+      pcre_set_bit(start_bits, tcode[1], caseless, cd);
       try_next = FALSE;
       break;
 
