From 60a9b3a67ae77fb689b36835a966a4c17f38db5f Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 5 Aug 2012 12:24:53 +0000 Subject: [PATCH] build: fix compilation by including and checking for regwexec. --- configure.ac | 1 + msvc/config.h | 3 ++- src/common/fd.c | 4 ++-- src/common/fd.h | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 8f9b53b..23d72cb 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,7 @@ AC_SUBST(DLL_LDFLAGS) AC_CHECK_HEADERS(windows.h winsock2.h io.h process.h unistd.h inttypes.h stdint.h libc.h malloc.h dlfcn.h regex.h sys/cdefs.h sys/socket.h netinet/in.h arpa/inet.h sys/uio.h aio.h sys/mman.h sys/wait.h sys/resource.h sys/time.h endian.h mach/task.h) AC_CHECK_FUNCS(setenv waitpid setrlimit gettimeofday fork kill pipe _pipe) +AC_CHECK_FUNCS(regexec regwexec) AC_CHECK_FUNCS(dup dup2 ftello fseeko _IO_getc getline getdelim fgetln map_fd memalign posix_memalign aio_read accept bind connect socket readv pread recv recvfrom recvmsg mmap valloc sigaction getpagesize) AC_CHECK_FUNCS(getc_unlocked getchar_unlocked fgetc_unlocked fread_unlocked fgets_unlocked) AC_CHECK_FUNCS(__getdelim __srefill __filbuf __srget __uflow) diff --git a/msvc/config.h b/msvc/config.h index d450faa..5a0f514 100644 --- a/msvc/config.h +++ b/msvc/config.h @@ -81,8 +81,9 @@ #define HAVE_RECV 1 #define HAVE_RECVFROM 1 /* #undef HAVE_RECVMSG */ -/* #undef HAVE_REGEX_H */ +/* #undef HAVE_REGEXEC */ #define HAVE_REGEX_H 1 +#define HAVE_REGWEXEC 1 #define HAVE_REOPENFILE 1 /* #undef HAVE_SETENV */ /* #undef HAVE_SETRLIMIT */ diff --git a/src/common/fd.c b/src/common/fd.c index a1d6085..372ca5d 100644 --- a/src/common/fd.c +++ b/src/common/fd.c @@ -199,7 +199,7 @@ void _zz_fd_fini(void) int _zz_mustwatch(char const *file) { -#if defined HAVE_REGEX_H +#if defined HAVE_REGEXEC if(has_include && regexec(&re_include, file, 0, NULL, 0) == REG_NOMATCH) return 0; /* not included: ignore */ @@ -214,7 +214,7 @@ int _zz_mustwatch(char const *file) int _zz_mustwatchw(wchar_t const *file) { -#if defined HAVE_REGEX_H +#if defined HAVE_REGWEXEC if(has_include && regwexec(&re_include, file, 0, NULL, 0) == REG_NOMATCH) return 0; /* not included: ignore */ diff --git a/src/common/fd.h b/src/common/fd.h index 2331e04..6976875 100644 --- a/src/common/fd.h +++ b/src/common/fd.h @@ -14,6 +14,9 @@ * fd.h: file descriptor functions */ +#include +#include + extern void _zz_include(char const *); extern void _zz_exclude(char const *); extern void _zz_setseed(int32_t);