summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2007-07-16 13:41:12 +0000
committerJani Taskinen <jani@php.net>2007-07-16 13:41:12 +0000
commit7c44729e412d0f9fe7b4301393082dfba67736a8 (patch)
tree928c79b840af735ff357958232bc931cbd9a8d85
parent514dfc34cab6628837ca6efbc95e37153f58a821 (diff)
downloadphp-git-7c44729e412d0f9fe7b4301393082dfba67736a8.tar.gz
- Cleanup and simplify
-rw-r--r--ext/ereg/config0.m48
-rw-r--r--ext/ereg/php_regex.h21
-rw-r--r--ext/ereg/regex/regex_extra.h23
-rw-r--r--ext/ereg/regex/utils.h2
-rw-r--r--sapi/apache/php_apache_http.h2
-rw-r--r--sapi/apache_hooks/php_apache_http.h1
6 files changed, 11 insertions, 46 deletions
diff --git a/ext/ereg/config0.m4 b/ext/ereg/config0.m4
index deacf6b154..f4f8190932 100644
--- a/ext/ereg/config0.m4
+++ b/ext/ereg/config0.m4
@@ -5,7 +5,7 @@ dnl
dnl Check for regex library type
dnl
PHP_ARG_WITH(regex,,
-[ --with-regex=TYPE regex library type: system, apache, php. [TYPE=php]
+[ --with-regex=TYPE regex library type: system, php. [TYPE=php]
WARNING: Do NOT use unless you know what you are doing!], php, no)
case $PHP_REGEX in
@@ -16,9 +16,6 @@ case $PHP_REGEX in
REGEX_TYPE=system
fi
;;
- apache)
- REGEX_TYPE=apache
- ;;
yes | php)
REGEX_TYPE=php
;;
@@ -34,9 +31,10 @@ AC_MSG_RESULT([$REGEX_TYPE])
if test "$REGEX_TYPE" = "php"; then
ereg_regex_sources="regex/regcomp.c regex/regexec.c regex/regerror.c regex/regfree.c"
ereg_regex_headers="regex/"
+ PHP_EREG_CFLAGS="-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp"
fi
-PHP_NEW_EXTENSION(ereg, ereg.c $ereg_regex_sources, no)
+PHP_NEW_EXTENSION(ereg, ereg.c $ereg_regex_sources, no,,$PHP_EREG_CFLAGS)
PHP_INSTALL_HEADERS([ext/ereg], [php_ereg.h php_regex.h $ereg_regex_headers])
if test "$REGEX_TYPE" = "php"; then
diff --git a/ext/ereg/php_regex.h b/ext/ereg/php_regex.h
index 3199a662b1..8f6362dc5b 100644
--- a/ext/ereg/php_regex.h
+++ b/ext/ereg/php_regex.h
@@ -27,15 +27,14 @@
* 1.. bundled regex
*/
-#if REGEX
-/* get aliases */
-#include "ext/ereg/regex/regex_extra.h"
-#include "ext/ereg/regex/regex.h"
+#if (REGEX == 1)
+/* Define aliases */
+#define regexec php_regexec
+#define regerror php_regerror
+#define regfree php_regfree
+#define regcomp php_regcomp
-/* get rid of aliases */
-#define PHP_NO_ALIASES
-#include "ext/ereg/regex/regex_extra.h"
-#undef PHP_NO_ALIASES
+#include "ext/ereg/regex/regex.h"
#undef _PCREPOSIX_H
#define _PCREPOSIX_H 1
@@ -55,6 +54,7 @@
#ifndef _H_REGEX
#define _H_REGEX 1 /* This one is for AIX */
#endif
+
#elif REGEX == 0
#include <regex.h>
#ifndef _REGEX_H_
@@ -63,8 +63,3 @@
#endif
#endif /* PHP_REGEX_H */
-
-/* No frame, regex_extra.h must be included always */
-#if (REGEX == 1 || REGEX == 0) && !defined(NO_REGEX_EXTRA_H)
-#include "ext/ereg/regex/regex_extra.h"
-#endif
diff --git a/ext/ereg/regex/regex_extra.h b/ext/ereg/regex/regex_extra.h
deleted file mode 100644
index d668f7613f..0000000000
--- a/ext/ereg/regex/regex_extra.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* do not frame this - we must be able to include this file multiple times */
-
-#undef regexec
-#undef regerror
-#undef regfree
-#undef regcomp
-
-#if (defined(REGEX) && REGEX == 1) || (!defined(REGEX))
-
-#ifndef PHP_WIN32
-
-#ifndef PHP_NO_ALIASES
-
-#define regexec php_regexec
-#define regerror php_regerror
-#define regfree php_regfree
-#define regcomp php_regcomp
-
-#endif
-
-#endif
-
-#endif
diff --git a/ext/ereg/regex/utils.h b/ext/ereg/regex/utils.h
index cd4a96025f..66ae78437e 100644
--- a/ext/ereg/regex/utils.h
+++ b/ext/ereg/regex/utils.h
@@ -1,7 +1,5 @@
/* utility definitions */
-#include "regex_extra.h"
-
#ifdef _POSIX2_RE_DUP_MAX
#define DUPMAX _POSIX2_RE_DUP_MAX
#else
diff --git a/sapi/apache/php_apache_http.h b/sapi/apache/php_apache_http.h
index f6049e8f43..a349405cae 100644
--- a/sapi/apache/php_apache_http.h
+++ b/sapi/apache/php_apache_http.h
@@ -20,8 +20,6 @@
/* $Id$ */
-#define NO_REGEX_EXTRA_H
-
#ifdef WIN32
#include <stddef.h>
#endif
diff --git a/sapi/apache_hooks/php_apache_http.h b/sapi/apache_hooks/php_apache_http.h
index 23cf7fea69..593d3abeaf 100644
--- a/sapi/apache_hooks/php_apache_http.h
+++ b/sapi/apache_hooks/php_apache_http.h
@@ -1,4 +1,3 @@
-#define NO_REGEX_EXTRA_H
#ifdef WIN32
#include <winsock2.h>