chiark / gitweb /
pcre.c, etc.: Support the PCRE2 library.
[anag] / anag.c
diff --git a/anag.c b/anag.c
index d4413bd1785b0e450ce2e971fc0c060f84020bd4..80da3c3267dce37b3b12ec2047ff46588a7686dd 100644 (file)
--- a/anag.c
+++ b/anag.c
@@ -1,13 +1,11 @@
 /* -*-c-*-
- *
- * $Id$
  *
  * Main driver for anag
  *
  * (c) 2001 Mark Wooding
  */
 
-/*----- Licensing notice --------------------------------------------------* 
+/*----- Licensing notice --------------------------------------------------*
  *
  * This file is part of Anag: a simple wordgame helper.
  *
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * Anag is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with Anag; if not, write to the Free Software Foundation,
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -74,7 +72,7 @@ The basic tests in the expression are:\n\
 -regexp REGEXP         matches with an (extended) regular expression\n\
 "
 #endif
-#ifdef HAVE_PCRE
+#if defined(HAVE_PCRE) || defined(HAVE_PCRE2)
 "\
 -pcre REGEXP           matches with a Perl-like regular expression\n\
 "
@@ -140,12 +138,12 @@ static const struct opt opttab[] = {
 #ifdef HAVE_REGCOMP
   { "regexp",          1,      0,              O_REGEXP },
 #endif
-#ifdef HAVE_PCRE
+#if defined(HAVE_PCRE) || defined(HAVE_PCRE2)
   { "pcre",            1,      0,              O_PCRE },
 #endif
-  { "length",          1,      0,              O_LENGTH },
-  { "longest",                 0,      0,              O_LONGEST },
-  { "shortest",                0,      0,              O_SHORTEST },
+  { "length",          1,      0,              O_LENGTH },
+  { "longest",         0,      0,              O_LONGEST },
+  { "shortest",                0,      0,              O_SHORTEST },
 
   /* --- End marker --- */
 
@@ -402,7 +400,7 @@ static void p_factor(p_ctx *p, node **nn)
 #ifdef HAVE_REGCOMP
       case O_REGEXP: *nn = regexp(p->a + 1); break;
 #endif
-#ifdef HAVE_PCRE
+#if defined(HAVE_PCRE) || defined(HAVE_PCRE2)
       case O_PCRE: *nn = pcrenode(p->a + 1); break;
 #endif
       case O_MONO: *nn = mono(p->a + 1); break;