diff mbox series

[1/4] poll (mingw): allow compiling with GCC 8 and DEVELOPER=1

Message ID fde98c32199a6570c721dbef7795e278b36224db.1560426581.git.gitgitgadget@gmail.com (mailing list archive)
State New, archived
Headers show
Series Support building with GCC v8.x/v9.x | expand

Commit Message

John Passaro via GitGitGadget June 13, 2019, 11:49 a.m. UTC
From: Johannes Schindelin <johannes.schindelin@gmx.de>

The return type of the `GetProcAddress()` function is `FARPROC` which
evaluates to `long long int (*)()`, i.e. it cannot be cast to the
correct function signature by GCC 8.

To work around that, we first cast to `void *` and go on with our merry
lives.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 compat/poll/poll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/compat/poll/poll.c b/compat/poll/poll.c
index 4459408c7d..8b07edb0fe 100644
--- a/compat/poll/poll.c
+++ b/compat/poll/poll.c
@@ -149,7 +149,7 @@  win32_compute_revents (HANDLE h, int *p_sought)
     case FILE_TYPE_PIPE:
       if (!once_only)
 	{
-	  NtQueryInformationFile = (PNtQueryInformationFile)
+	  NtQueryInformationFile = (PNtQueryInformationFile)(void (*)(void))
 	    GetProcAddress (GetModuleHandle ("ntdll.dll"),
 			    "NtQueryInformationFile");
 	  once_only = TRUE;