Skip to content

Fix GH-15501: Windows HAVE_<header>_H macros defined to 1 or undefined #15508

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

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ PHP NEWS
. Fixed bug GH-15187 (Various hooked object iterator issues). (ilutov)
. Fixed bug GH-15456 (Crash in get_class_vars() on virtual properties).
(ilutov)
. Fixed bug GH-15501 (Windows HAVE_<header>_H macros defined to 1 or
undefined). (Peter Kokot)

15 Aug 2024, PHP 8.4.0beta3

Expand Down
3 changes: 3 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ PHP 8.4 INTERNALS UPGRADE NOTES
- Added configure option --enable-phpdbg-debug to build phpdbg in debug mode.
- The win32/build/libs_version.txt file has been removed.
- MSVC builds now use the new preprocessor (/Zc:preprocessor).
- The CHECK_HEADER_ADD_INCLUDE function now consistently defines preprocessor
macros HAVE_<header>_H either to value 1 or leaves them undefined to match
the Autotools headers checks.

========================
3. Module changes
Expand Down
2 changes: 1 addition & 1 deletion ext/com_dotnet/com_dotnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "php.h"

#if HAVE_MSCOREE_H
#ifdef HAVE_MSCOREE_H
# include "php_ini.h"
# include "ext/standard/info.h"
# include "php_com_dotnet.h"
Expand Down
8 changes: 4 additions & 4 deletions ext/com_dotnet/com_extension.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
tmp->create_object = php_com_object_new;
tmp->get_iterator = php_com_iter_get;

#if HAVE_MSCOREE_H
#ifdef HAVE_MSCOREE_H
tmp = register_class_dotnet(php_com_variant_class_entry);
tmp->default_object_handlers = &php_com_object_handlers;
tmp->create_object = php_com_object_new;
Expand All @@ -216,7 +216,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
PHP_MSHUTDOWN_FUNCTION(com_dotnet)
{
UNREGISTER_INI_ENTRIES();
#if HAVE_MSCOREE_H
#ifdef HAVE_MSCOREE_H
if (COMG(dotnet_runtime_stuff)) {
php_com_dotnet_mshutdown();
}
Expand All @@ -239,7 +239,7 @@ PHP_RINIT_FUNCTION(com_dotnet)
/* {{{ PHP_RSHUTDOWN_FUNCTION */
PHP_RSHUTDOWN_FUNCTION(com_dotnet)
{
#if HAVE_MSCOREE_H
#ifdef HAVE_MSCOREE_H
if (COMG(dotnet_runtime_stuff)) {
php_com_dotnet_rshutdown();
}
Expand All @@ -257,7 +257,7 @@ PHP_MINFO_FUNCTION(com_dotnet)
php_info_print_table_row(2, "COM support", "enabled");
php_info_print_table_row(2, "DCOM support", COMG(allow_dcom) ? "enabled" : "disabled");

#if HAVE_MSCOREE_H
#ifdef HAVE_MSCOREE_H
php_info_print_table_row(2, ".Net support", "enabled");
#else
php_info_print_table_row(2, ".Net support", "not present in this build");
Expand Down
2 changes: 1 addition & 1 deletion ext/com_dotnet/com_extension.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class com extends variant
public function __construct(string $module_name, array|string|null $server_name = null, int $codepage = CP_ACP, string $typelib = "") {}
}

#if HAVE_MSCOREE_H
#ifdef HAVE_MSCOREE_H
class dotnet extends variant
{
public function __construct(string $assembly_name, string $datatype_name, int $codepage = CP_ACP) {}
Expand Down
10 changes: 5 additions & 5 deletions ext/com_dotnet/com_extension_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions win32/build/confutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,10 +1040,10 @@ function CHECK_HEADER_ADD_INCLUDE(header_name, flag_name, path_to_check, use_env
add_to_flag_only = true;
}

if (typeof(add_to_flag_only) != "undefined") {
if (typeof(add_to_flag_only) != "undefined" && have) {
ADD_FLAG(flag_name, "/DHAVE_" + sym + "=" + have);
} else if (!configure_hdr.Exists('HAVE_' + sym)) {
AC_DEFINE("HAVE_" + sym, have, "have the " + header_name + " header file");
} else if (!configure_hdr.Exists('HAVE_' + sym) && have) {
AC_DEFINE("HAVE_" + sym, have, "Define to 1 if you have the <" + header_name + "> header file.");
}

return p;
Expand Down
Loading