Skip to content

Commit 35ed3c5

Browse files
committed
Refactor ext/mbstring/libmbfl/config.h usage
This simplifies the libmbfl/config.h usage and removes duplicate compile definitions on Windows (HAVE_STRICMP). The _WIN32 symbol is always defined when compiling on Windows with any current compiler, the HAVE_CONFIG_H symbol is defined only when doing phpize build inside mbstring extension (an edge case but if that is used by someone perhaps), otherwise the regular main/php_config.h is used.
1 parent 94d18cb commit 35ed3c5

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,5 +294,6 @@ tmp-php.ini
294294
!/ext/fileinfo/libmagic.patch
295295
!/ext/fileinfo/magicdata.patch
296296
!/ext/dom/lexbor/patches/*.patch
297+
!/ext/mbstring/libmbfl/config.h
297298
!/ext/pcre/pcre2lib/config.h
298299
!/win32/build/Makefile

ext/mbstring/config.m4

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
3535
PHP_ADD_INCLUDE([$ext_builddir/$dir])
3636
done
3737
38-
out="php_config.h"
39-
40-
if test "$ext_shared" != "no" && test -f "$ext_builddir/config.h.in"; then
41-
out="$abs_builddir/config.h"
42-
fi
43-
44-
cat > $ext_builddir/libmbfl/config.h <<EOF
45-
#include "$out"
46-
EOF
47-
4838
PHP_MBSTRING_ADD_INSTALL_HEADERS([mbstring.h])
4939
PHP_INSTALL_HEADERS([ext/mbstring], [$PHP_MBSTRING_INSTALL_HEADERS])
5040
])

ext/mbstring/config.w32

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ if (PHP_MBSTRING != "no") {
1111
STDOUT.WriteLine("Using bundled libmbfl...");
1212

1313
ADD_FLAG("CFLAGS_MBSTRING", "-Iext/mbstring -Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
14-
/D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")
15-
16-
FSO.CopyFile("ext\\mbstring\\libmbfl\\config.h.w32",
17-
"ext\\mbstring\\libmbfl\\config.h", true);
14+
/D MBFL_DLL_EXPORT=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1")
1815

1916
ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
2017
mbfilter_7bit.c mbfilter_base64.c \

ext/mbstring/libmbfl/config.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#ifdef _WIN32
2+
# define HAVE_STRICMP 1
3+
#elif defined(HAVE_CONFIG_H)
4+
# include <config.h>
5+
#else
6+
# include <main/php_config.h>
7+
#endif

ext/mbstring/libmbfl/config.h.w32

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)