[php-src] PR #15508: Fix GH-15501: Windows HAVE_<header>_H macros defined to 1 or undefined
| From: | petk | Date: | Tue, 20 Aug 2024 13:27:32 +0000 |
| Subject: | [php-src] PR #15508: Fix GH-15501: Windows HAVE_<header>_H macros defined to 1 or undefined | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28082@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/15508
Author: petk
I should probably fine tune this explanation to make it easier to understand but anyway...
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.