Skip to content

Commit 2480586

Browse files
Fix tests
1 parent adff1f2 commit 2480586

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

config.m4

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ if test "$PHP_SPX" = "yes"; then
1919
AC_DEFINE_UNQUOTED([SPX_HTTP_UI_ASSETS_DIR], [ "$PHP_SPX_ASSETS_DIR/web-ui" ], [path of web-ui assets directory])
2020
PHP_SUBST([PHP_SPX_ASSETS_DIR])
2121

22-
CFLAGS="$CFLAGS -Werror -Wall -Wno-attributes -O3 -pthread -std=c11"
22+
CFLAGS="$CFLAGS -Werror -Wall -Wno-attributes -O3 -pthread"
23+
24+
php_ver_num=$(echo $PHP_VERSION | awk -F. '{printf("%d%02d%02d",$1,$2,$3)}')
25+
if test "$php_ver_num" -ge 80200; then
26+
CFLAGS="$CFLAGS -std=c11"
27+
AC_MSG_NOTICE([Adding -std=c11 because PHP >= 8.2])
28+
else
29+
AC_MSG_NOTICE([Not adding -std=c11 because PHP < 8.2])
30+
fi
2331

2432
# Disabling typedef-redefinition is required for:
2533
# - macOS, see https://github.com/NoiseByNorthwest/php-spx/pull/270

0 commit comments

Comments
 (0)