use system regex routines if available.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@414 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-03-12 16:30:23 +00:00
parent ba03bd25be
commit 79e37862cb
2 changed files with 11 additions and 3 deletions

View File

@ -33,8 +33,8 @@ SHLIB_SUFFIX=@SHLIB_SUFFIX@
CWD=$(PWD)
#
OBJS=regexp.o regcomp.o regexec.o regerror.o regfree.o
SOBJS=regexp@SHLIB_SUFFIX@ regcomp@SHLIB_SUFFIX@ regexec@SHLIB_SUFFIX@ regerror@SHLIB_SUFFIX@ regfree@SHLIB_SUFFIX@
OBJS=regexp.o @NO_BUILTIN_REGEXP@ regcomp.o regexec.o regerror.o regfree.o
SOBJS=regexp@SHLIB_SUFFIX@ @NO_BUILTIN_REGEXP@ regcomp@SHLIB_SUFFIX@ regexec@SHLIB_SUFFIX@ regerror@SHLIB_SUFFIX@ regfree@SHLIB_SUFFIX@
#in some systems we just create a single object, in others we need to
# create a libray
@ -45,7 +45,7 @@ sobjs: $(SOBJS)
dll: regexp@SHLIB_SUFFIX@
regexp.o: $(srcdir)/regexp.c $(srcdir)/regex2.h $(srcdir)/engine.c
regexp.o: $(srcdir)/regexp.c @NO_BUILTIN_REGEXP@ $(srcdir)/regex2.h $(srcdir)/engine.c
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/regexp.c -o regexp.o
regcomp.o: $(srcdir)/regcomp.c $(srcdir)/regex2.h

View File

@ -20,7 +20,15 @@
#include <sys/types.h>
#endif
#include "c_interface.h"
#if HAVE_REGEX_H
#include "regex.h"
#define yap_regcomp(A,B,C) regcomp(A,B,C)
#define yap_regexec(A,B,C,D,E) regexec(A,B,C,D,E)
#define yap_regfree(A) regfree(A)
#define yap_regerror(A,B,C,D) regfree(A,B,C,D)
#else
#include "yapregex.h"
#endif
/* for the sake of NULL */
#include <stdio.h>