diff --git a/src/SPC/store/SourcePatcher.php b/src/SPC/store/SourcePatcher.php index 47b8c05f..4b37f2d9 100644 --- a/src/SPC/store/SourcePatcher.php +++ b/src/SPC/store/SourcePatcher.php @@ -205,6 +205,19 @@ class SourcePatcher 'PHP_ADD_INCLUDE([$ext_srcdir])', "PHP_ADD_INCLUDE( [\$ext_srcdir] )\n PHP_ADD_INCLUDE([\$abs_srcdir/ext])" ); + // swoole 5.1.3 build fix + // get swoole version first + $file = SOURCE_PATH . '/php-src/ext/swoole/include/swoole_version.h'; + // Match #define SWOOLE_VERSION "5.1.3" + $pattern = '/#define SWOOLE_VERSION "(.+)"/'; + if (preg_match($pattern, file_get_contents($file), $matches)) { + $version = $matches[1]; + } else { + $version = '1.0.0'; + } + if ($version === '5.1.3') { + self::patchFile('spc_fix_swoole_50513.patch', SOURCE_PATH . '/php-src/ext/swoole'); + } return true; } diff --git a/src/globals/patch/spc_fix_swoole_50513.patch b/src/globals/patch/spc_fix_swoole_50513.patch new file mode 100644 index 00000000..c9fac792 --- /dev/null +++ b/src/globals/patch/spc_fix_swoole_50513.patch @@ -0,0 +1,27 @@ +diff --git a/ext-src/php_swoole_call_stack.h b/ext-src/php_swoole_call_stack.h +index 8c89f83..639a303 100644 +--- a/ext-src/php_swoole_call_stack.h ++++ b/ext-src/php_swoole_call_stack.h +@@ -18,8 +18,8 @@ + + #ifdef ZEND_CHECK_STACK_LIMIT + #define HOOK_PHP_CALL_STACK(callback) \ +- auto __stack_limit = EG(stack_limit); \ +- auto __stack_base = EG(stack_base); \ ++ void *__stack_limit = EG(stack_limit); \ ++ void *__stack_base = EG(stack_base); \ + EG(stack_base) = (void *) 0; \ + EG(stack_limit) = (void *) 0; \ + callback EG(stack_limit) = __stack_limit; \ +diff --git a/thirdparty/php83/pdo_odbc/odbc_driver.c b/thirdparty/php83/pdo_odbc/odbc_driver.c +index c83da64..a5e3a8b 100644 +--- a/thirdparty/php83/pdo_odbc/odbc_driver.c ++++ b/thirdparty/php83/pdo_odbc/odbc_driver.c +@@ -25,6 +25,7 @@ + #include "pdo/php_pdo.h" + #include "pdo/php_pdo_driver.h" + #include "zend_exceptions.h" ++#include + + static void pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) { + pdo_odbc_db_handle *H = (pdo_odbc_db_handle *) dbh->driver_data;