-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Declare ext/mbstring constants in stubs #8798
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Looks good overall to me. I wonder, though, whether we want to use some macro expansion trickery to get the MB_ONIGURUMA_VERSION
value, instead of assembling it via runtime.
@alexdowad may also want to review.
Thanks, looks good. |
I like the idea, and I wasn't pleased that I had to add a global variable. However, I didn't manage to make the macro expansion trickery work. :( |
@kocsismate, you can do something like: #define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#define PHP_ONIGURUMA_VERSION STR(ONIGURUMA_VERSION_MAJOR) "." STR(ONIGURUMA_VERSION_MINOR) "." STR(ONIGURUMA_VERSION_TEENY) The |
Thank you for the suggestion, but that's exactly what I tried. Unfortunately, I got the constant names printed instead of the values. I don't have any idea what causes this. |
It works for me on Windows (MSVC) and Debian (WSL; gcc). Are you sure that you're using the indirection? The following is supposed to show the constant names: #define STR(x) #x
#define PHP_ONIGURUMA_VERSION STR(ONIGURUMA_VERSION_MAJOR) "." STR(ONIGURUMA_VERSION_MINOR) "." STR(ONIGURUMA_VERSION_TEENY) |
Yes, sure! I've just tried to use the original |
Oh, indeed, there is an inclusion (order) issue. |
I'm going to simply go with the current solution :) |
No description provided.