Skip to content

Windows compilation issue: php-src\Zend\zend_exceptions.h(75): error C2122: 'message': prototype parameter in name list illegal #18820

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
EdmondDantes opened this issue Jun 10, 2025 · 3 comments

Comments

@EdmondDantes
Copy link

Description

https://github.com/true-async/php-src/blob/3e14dd521ffe5bdcadec031505590b49a1b564eb/Zend/zend_exceptions.h#L75-L75

There is a suspicion that the combination of BEGIN_EXTERN_C() + INTERNAL_FUNCTION_PARAMETERS macro with additional parameters doesn't work for MSVC in C++ mode.

Errors:

php-src\Zend\zend_exceptions.h(75): error C2122: 'message': prototype parameter in name list illegal
php-src\Zend\zend_exceptions.h(75): error C2122: 'code': prototype parameter in name list illegal
php-src\Zend\zend_exceptions.h(75): error C2122: 'previous': prototype parameter in name list illegal
BEGIN_EXTERN_C()
ZEND_API zend_result zend_update_exception_properties(INTERNAL_FUNCTION_PARAMETERS, zend_string *message, zend_long code, zval *previous);
END_EXTERN_C()

PHP Version

PHP 8.4.0

Operating System

WINDOWS 11

@nielsdos
Copy link
Member

nielsdos commented Jun 10, 2025

Does it work when you replace INTERNAL_FUNCTION_PARAMETERS in the line of zend_update_exception_properties with zend_execute_data *execute_data, zval *return_value ? That seems to work for me.
The reason would be that INTERNAL_FUNCTION_PARAMETERS is defined in zend.h which is not included (and probably should indeed not be included).

@EdmondDantes
Copy link
Author

Yes, that’s exactly how it works. I actually thought it was a compiler issue, but apparently it’s not. Thank you!

@TimWolla
Copy link
Member

This seems to be an actual issue, so reopening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants