]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: Define PSAPI_VERSION as 1 before including psapi.h
authorJon Turney <jon.turney@dronecode.org.uk>
Thu, 20 May 2021 17:28:01 +0000 (18:28 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Fri, 9 Jul 2021 12:24:08 +0000 (13:24 +0100)
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/cygwin/dlfcn.cc
winsup/cygwin/resource.cc
winsup/utils/dumper.cc
winsup/utils/ldd.cc
winsup/utils/mingw/bloda.cc
winsup/utils/module_info.cc
winsup/utils/pldd.c
winsup/utils/ps.cc

index c675a57851e298fcc5e88052364bf5ec3edb2f0f..9a7472850b0a63c50f319259f3392fa0c35a3fc5 100644 (file)
@@ -7,7 +7,6 @@ Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */
 
 #include "winsup.h"
-#include <psapi.h>
 #include <stdlib.h>
 #include <dlfcn.h>
 #include <ctype.h>
index 97777e9d223466b7635b990d6c9e0bfb9e2e9a46..1664bca0fee026951be8ebc2227de38159401a23 100644 (file)
@@ -14,7 +14,6 @@ details. */
 #include <unistd.h>
 #include <sys/param.h>
 #include "pinfo.h"
-#include "psapi.h"
 #include "cygtls.h"
 #include "path.h"
 #include "fhandler.h"
index f21c93bf7f5dc7f7f6531578111f497e901c578f..bc6c68a535b7b8f04fde5454944e57efe8f46b39 100644 (file)
@@ -34,6 +34,7 @@
 #include <unistd.h>
 #include <sys/param.h>
 #include <windows.h>
+#define PSAPI_VERSION 1
 #include <psapi.h>
 
 #include "dumper.h"
index f9b04ed10ffc24d47c82a07da802870ed80368f4..0d073c29898f5520c41f76e9dfb4816cd1d99522 100644 (file)
 #include <unistd.h>
 #include <libgen.h>
 
-#define PSAPI_VERSION 1
 #include <windows.h>
 #include <winternl.h>
 #include <imagehlp.h>
+#define PSAPI_VERSION 1
 #include <psapi.h>
 
 struct option longopts[] =
index ffaee5229da19633c803c941342996d0b4841c43..330ac556ff0fb9078674a4e4b844d5bb030b441f 100644 (file)
@@ -13,6 +13,7 @@
                           ntstatus.h for extended status codes below. */
 #include <windows.h>
 #undef WIN32_NO_STATUS
+#define PSAPI_VERSION 1
 #include <psapi.h>
 #include <winternl.h>
 #include <ntstatus.h>
index bf3a18bf35c134f1d569eb9104870ed051e0a17c..e0bd4b71aab1ef6c9b0514f068a3c34cdff6eeb6 100644 (file)
@@ -10,6 +10,7 @@ details. */
 
 #include <stdlib.h>
 #include <windows.h>
+#define PSAPI_VERSION 1
 #include <psapi.h>
 #include "loadlib.h"
 
index f077e63ab5a9ad9e3caf544568ee109e410346c0..2c085eaa2a7134c1a700a8014d3ef093f3a36356 100644 (file)
@@ -16,6 +16,7 @@ details. */
 #include <sys/cygwin.h>
 #include <cygwin/version.h>
 #include <windows.h>
+#define PSAPI_VERSION 1
 #include <psapi.h>
 
 struct option longopts[] =
index 478ed8efd27e98f0c5a4795242e7f9ccd523b689..b516575353204fcccf092a7bf1ef7a06b977fac2 100644 (file)
@@ -19,7 +19,6 @@ details. */
 #include <limits.h>
 #include <sys/cygwin.h>
 #include <cygwin/version.h>
-#include <psapi.h>
 #include <ntdef.h>
 #include <ntdll.h>
 #include "loadlib.h"
This page took 0.042657 seconds and 5 git commands to generate.