[Pcre-svn] [343] code/trunk: Fixes to pcretest for readline …

Página Inicial
Delete this message
Autor: Subversion repository
Data:  
Para: pcre-svn
Assunto: [Pcre-svn] [343] code/trunk: Fixes to pcretest for readline support on Windows.
Revision: 343
          http://vcs.pcre.org/viewvc?view=rev&revision=343
Author:   ph10
Date:     2008-04-21 17:30:37 +0100 (Mon, 21 Apr 2008)


Log Message:
-----------
Fixes to pcretest for readline support on Windows.

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


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2008-04-20 17:10:13 UTC (rev 342)
+++ code/trunk/ChangeLog    2008-04-21 16:30:37 UTC (rev 343)
@@ -93,6 +93,10 @@
     improvement to matching performance by compiling OP_ALLANY instead of 
     OP_ANY for "." when DOTALL was set, and then removing the runtime tests 
     on the OP_ANY path. 
+    
+17. Compiling pcretest on Windows with readline support failed without the 
+    following two fixes: (1) Make the unistd.h include conditional on
+    HAVE_UNISTD_H; (2) #define isatty and fileno as _isatty and _fileno. 



Version 7.6 28-Jan-08

Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2008-04-20 17:10:13 UTC (rev 342)
+++ code/trunk/pcretest.c    2008-04-21 16:30:37 UTC (rev 343)
@@ -49,7 +49,9 @@
 #include <errno.h>


#ifdef SUPPORT_LIBREADLINE
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <readline/readline.h>
#include <readline/history.h>
#endif
@@ -69,6 +71,9 @@
#define INPUT_MODE "r"
#define OUTPUT_MODE "wb"

+#define isatty _isatty         /* This is what Windows calls them, I'm told */
+#define fileno _fileno
+
 #else
 #include <sys/time.h>          /* These two includes are needed */
 #include <sys/resource.h>      /* for setrlimit(). */