Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: pcre module again



Someone e-mailed me to complain that he was getting
a "no setup function" error.

Index: Src/Modules/pcre.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/pcre.c,v
retrieving revision 1.3
diff -u -r1.3 pcre.c
--- Src/Modules/pcre.c	2001/07/04 15:13:33	1.3
+++ Src/Modules/pcre.c	2001/07/04 16:13:46
@@ -83,8 +83,13 @@
 }
 
 /**/
-#endif /* HAVE_PCRE_STUDY */
+#else /* !HAVE_PCRE_STUDY */
 
+# define bin_pcre_study bin_notavail
+
+/**/
+#endif /* !HAVE_PCRE_STUDY */
+
 /**/
 static int
 bin_pcre_match(char *nam, char **args, char *ops, int func)
@@ -134,11 +139,19 @@
     return 1;
 }
 
+/**/
+#else /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */
+
+# define bin_pcre_compile bin_notavail
+# define bin_pcre_study bin_notavail
+# define bin_pcre_match bin_notavail
+
+/**/
+#endif /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */
+
 static struct builtin bintab[] = {
     BUILTIN("pcre_compile", 0, bin_pcre_compile, 1, 1, 0, "aimx",  NULL),
-#ifdef HAVE_PCRE_STUDY
     BUILTIN("pcre_study",   0, bin_pcre_study,   0, 0, 0, NULL,    NULL),
-#endif
     BUILTIN("pcre_match",   0, bin_pcre_match,   1, 2, 0, "a",    NULL)
 };
 
@@ -170,6 +183,3 @@
 {
     return 0;
 }
-
-/**/
-#endif /* HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC */



Messages sorted by: Reverse Date, Date, Thread, Author