public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Ensure PSAPI_VERSION is 1 when building ldd
@ 2021-05-20 17:46 Jon Turney
  2021-05-20 18:05 ` Corinna Vinschen
  0 siblings, 1 reply; 13+ messages in thread
From: Jon Turney @ 2021-05-20 17:46 UTC (permalink / raw)
  To: cygwin-patches; +Cc: Jon Turney

The default PSAPI_VERSION is controlled by WIN32_WINNT, which we set to
0x0a00 when building ldd, which gets PSAPI_VERSION=2.

This causes K32GetModuleFileNameEx to be used for GetFileNameFromHandle,
which isn't available on Windows Vista.

Define PSAPI_VERSION as 1 for the built executable to work on Windows
Vista.
---
 winsup/utils/ldd.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/winsup/utils/ldd.cc b/winsup/utils/ldd.cc
index 1e1863c1c..d370db986 100644
--- a/winsup/utils/ldd.cc
+++ b/winsup/utils/ldd.cc
@@ -38,6 +38,7 @@
 #include <libgen.h>
 
 #define _WIN32_WINNT 0x0a00
+#define PSAPI_VERSION 1
 #include <windows.h>
 #include <winternl.h>
 #include <imagehlp.h>
-- 
2.31.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-07-06 13:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20 17:46 [PATCH] Ensure PSAPI_VERSION is 1 when building ldd Jon Turney
2021-05-20 18:05 ` Corinna Vinschen
2021-05-22 15:08   ` Jon Turney
2021-05-25 21:37     ` Jon Turney
2021-05-26  9:04       ` Corinna Vinschen
2021-05-26 16:51         ` Jon Turney
2021-05-26 17:04           ` Yaakov Selkowitz
2021-05-26 19:18             ` Corinna Vinschen
2021-05-27 17:30               ` Jon Turney
2021-05-27 19:08                 ` Corinna Vinschen
2021-05-28 15:13                   ` Jon Turney
2021-06-20 13:37                     ` [PATCH] Define PSAPI_VERSION as 1 before including psapi.h Jon Turney
2021-07-06 13:55                       ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).