diff --git a/Lib/exception.i b/Lib/exception.i index 7508b409b..5cdea58e8 100644 --- a/Lib/exception.i +++ b/Lib/exception.i @@ -14,14 +14,14 @@ #ifdef SWIGPHP %{ -#if PHP_MAJOR >= 8 -# define SWIG_HANDLE_VALUE_ERROR_FOR_PHP8 code == SWIG_ValueError ? zend_ce_value_error : +#if PHP_MAJOR_VERSION >= 8 +# define SWIG_HANDLE_VALUE_ERROR_FOR_PHP8(code) code == SWIG_ValueError ? zend_ce_value_error : #else -# define SWIG_HANDLE_VALUE_ERROR_FOR_PHP8 +# define SWIG_HANDLE_VALUE_ERROR_FOR_PHP8(code) #endif #define SWIG_exception(code, msg) do { zend_throw_exception( \ code == SWIG_TypeError ? zend_ce_type_error : \ - SWIG_HANDLE_VALUE_ERROR_FOR_PHP8 \ + SWIG_HANDLE_VALUE_ERROR_FOR_PHP8(code) \ code == SWIG_DivisionByZero ? zend_ce_division_by_zero_error : \ code == SWIG_SyntaxError ? zend_ce_parse_error : \ code == SWIG_OverflowError ? zend_ce_arithmetic_error : \ diff --git a/Lib/php/phpinterfaces.i b/Lib/php/phpinterfaces.i index dda219d91..5b1da8b79 100644 --- a/Lib/php/phpinterfaces.i +++ b/Lib/php/phpinterfaces.i @@ -54,7 +54,7 @@ #define SWIG_PHP_INTERFACE_JsonSerializable_HEADER "ext/json/php_json.h" // New in PHP 8.0. -#if PHP_MAJOR >= 8 +#if PHP_MAJOR_VERSION >= 8 # define SWIG_PHP_INTERFACE_Stringable_CE zend_ce_stringable # define SWIG_PHP_INTERFACE_Stringable_HEADER "zend_interfaces.h" #endif