[Pcre-svn] [586] code/trunk: Move definition of pcregrep_exi…

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [586] code/trunk: Move definition of pcregrep_exit() above its first reference; this applies only
Revision: 586
          http://vcs.pcre.org/viewvc?view=rev&revision=586
Author:   ph10
Date:     2011-01-12 17:36:47 +0000 (Wed, 12 Jan 2011)


Log Message:
-----------
Move definition of pcregrep_exit() above its first reference; this applies only
to Windows.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcregrep.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2011-01-12 17:21:11 UTC (rev 585)
+++ code/trunk/ChangeLog    2011-01-12 17:36:47 UTC (rev 586)
@@ -16,6 +16,11 @@
     did strange things, either producing crazy output, or crashing. It should,
     of course, ignore a request for colour when reporting lines that do not 
     match. 
+    
+4.  If pcregrep was compiled under Windows, there was a reference to the 
+    function pcregrep_exit() before it was defined. I am assuming this was
+    the cause of the "error C2371: 'pcregrep_exit' : redefinition;" that was 
+    reported by a user. I've moved the definition above the reference.



Version 8.11 10-Dec-2010

Modified: code/trunk/pcregrep.c
===================================================================
--- code/trunk/pcregrep.c    2011-01-12 17:21:11 UTC (rev 585)
+++ code/trunk/pcregrep.c    2011-01-12 17:36:47 UTC (rev 586)
@@ -296,6 +296,30 @@



 /*************************************************
+*         Exit from the program                  *
+*************************************************/
+
+/* If there has been a resource error, give a suitable message.
+
+Argument:  the return code
+Returns:   does not return
+*/
+
+static void
+pcregrep_exit(int rc)
+{
+if (resource_error)
+  {
+  fprintf(stderr, "pcregrep: Error %d or %d means that a resource limit "
+    "was exceeded.\n", PCRE_ERROR_MATCHLIMIT, PCRE_ERROR_RECURSIONLIMIT);
+  fprintf(stderr, "pcregrep: Check your regex for nested unlimited loops.\n");
+  }
+
+exit(rc);
+}
+
+
+/*************************************************
 *            OS-specific functions               *
 *************************************************/


@@ -565,31 +589,6 @@


 /*************************************************
-*         Exit from the program                  *
-*************************************************/
-
-/* If there has been a resource error, give a suitable message.
-
-Argument:  the return code
-Returns:   does not return
-*/
-
-static void
-pcregrep_exit(int rc)
-{
-if (resource_error)
-  {
-  fprintf(stderr, "pcregrep: Error %d or %d means that a resource limit "
-    "was exceeded.\n", PCRE_ERROR_MATCHLIMIT, PCRE_ERROR_RECURSIONLIMIT);
-  fprintf(stderr, "pcregrep: Check your regex for nested unlimited loops.\n");
-  }
-
-exit(rc);
-}
-
-
-
-/*************************************************
 *            Read one line of input              *
 *************************************************/