From 9a231073a5978189902183ee7d1ea7390106a318 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 20 May 2021 18:28:01 +0100 Subject: Cygwin: Define PSAPI_VERSION as 1 before including psapi.h The default PSAPI_VERSION is controlled by WIN32_WINNT, which we set to 0x0a00 when building utils since 48a76190 (and is the default in w32api >= 9.0.0) In order for the built executables to run on Windows Vista, we must also define PSAPI_VERSION as 1 (otherwise '#define GetModuleFileNameExA K32GetModuleFileNameExA' causes a 'The procedure entry point K32GetModuleFilenameExA could not be located in the dynamic link library kernel32.dll' error at run time). Also drop uneeded psapi.h from dlfcn.cc (31ddf45d), resource.cc (34a6eeab) and ps.cc (1def2148). --- winsup/utils/dumper.cc | 1 + winsup/utils/ldd.cc | 2 +- winsup/utils/mingw/bloda.cc | 1 + winsup/utils/module_info.cc | 1 + winsup/utils/pldd.c | 1 + winsup/utils/ps.cc | 1 - 6 files changed, 5 insertions(+), 2 deletions(-) (limited to 'winsup/utils') diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc index f21c93b..bc6c68a 100644 --- a/winsup/utils/dumper.cc +++ b/winsup/utils/dumper.cc @@ -34,6 +34,7 @@ #include #include #include +#define PSAPI_VERSION 1 #include #include "dumper.h" diff --git a/winsup/utils/ldd.cc b/winsup/utils/ldd.cc index f9b04ed..0d073c2 100644 --- a/winsup/utils/ldd.cc +++ b/winsup/utils/ldd.cc @@ -37,10 +37,10 @@ #include #include -#define PSAPI_VERSION 1 #include #include #include +#define PSAPI_VERSION 1 #include struct option longopts[] = diff --git a/winsup/utils/mingw/bloda.cc b/winsup/utils/mingw/bloda.cc index ffaee52..330ac55 100644 --- a/winsup/utils/mingw/bloda.cc +++ b/winsup/utils/mingw/bloda.cc @@ -13,6 +13,7 @@ ntstatus.h for extended status codes below. */ #include #undef WIN32_NO_STATUS +#define PSAPI_VERSION 1 #include #include #include diff --git a/winsup/utils/module_info.cc b/winsup/utils/module_info.cc index bf3a18b..e0bd4b7 100644 --- a/winsup/utils/module_info.cc +++ b/winsup/utils/module_info.cc @@ -10,6 +10,7 @@ details. */ #include #include +#define PSAPI_VERSION 1 #include #include "loadlib.h" diff --git a/winsup/utils/pldd.c b/winsup/utils/pldd.c index f077e63..2c085ea 100644 --- a/winsup/utils/pldd.c +++ b/winsup/utils/pldd.c @@ -16,6 +16,7 @@ details. */ #include #include #include +#define PSAPI_VERSION 1 #include struct option longopts[] = diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc index 478ed8e..b516575 100644 --- a/winsup/utils/ps.cc +++ b/winsup/utils/ps.cc @@ -19,7 +19,6 @@ details. */ #include #include #include -#include #include #include #include "loadlib.h" -- cgit v1.1