-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Windows build system defines HAVE_<header>_H as 0 or 1 #15501
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
Comments
Going from Anyhow, I think matching autotools behavior more closely is overall a good thing, but we should not do this for stable branches, but only for Do you want to submit your patch as PR? |
Previously the CHECK_HEADER_ADD_INCLUDE function defined the HAVE_<header>_H preprocessor macros to value 0 or 1 whether the <header.h> file was found. This syncs it with Autotools build system where most of these macros are either undefined or defined to 1. In possible edge cases where such macros might be intentionally used like this without being aware that HAVE_HEADER_H can be 0 or 1 on Windows: | #ifdef HAVE_HEADER_H | ... | #endif there is backwards incompatibility for PECL extensions in case the header wouldn't exist on Windows such code wouldn't execute. However, this is considered a bug if such case is present. From the Autotools point of view, the check is correct though and should be used with ifdef/defined() checks. Help text is also synced to Autotools style: "Define to 1 if you have the <header.h> header file". Fixes phpGH-15501
…ined Previously the CHECK_HEADER_ADD_INCLUDE function defined the `HAVE_<header>_H` preprocessor macros to value 0 or 1 whether the `<header.h>` file was found. This syncs it with Autotools build system where most of these macros are either undefined or defined to 1. In possible edge cases where such macros might be intentionally used like this without being aware that HAVE_HEADER_H can be 0 or 1 on Windows: | #ifdef HAVE_HEADER_H | ... | #endif there is backwards incompatibility for PECL extensions in case the header wouldn't exist on Windows such code wouldn't execute. However, this is considered a bug if such case is present. From the Autotools point of view, the check is correct though and should be used with ifdef/defined() checks. Help text is also synced to Autotools style: `Define to 1 if you have the <header.h> header file.`
Perhaps it can be done in PHP 8.4 then. Ok, appended the PR for this. |
Description
When using
CHECK_HEADER_ADD_INCLUDE
in *.w32 Windows build system files there is an inconsistency with Autotools build system where most header check macros are of style undefined/defined to 1.For example, this:
Will define the HAVE_FOOBAR_H to a value 0 in the
main/config.w32.h
:However most of these headers are used in the code like this:
Affected headers in php-src:
zlib.h
sql.h
sqlext.h
timelib_config.h
tidy.h
tidybuffio.h
Since php-src Windows environment is very locked to exact libraries and the build can be mostly reproduced this probably isn't much of an issue but it might affect PHP extensions out there.
PHP Version
PHP 8.2+
Operating System
Windows
Patch that fixes this in a "simple" way but it is a BC break for community extensions:
The text was updated successfully, but these errors were encountered: