]> granicus.if.org Git - git/commitdiff
poll (mingw): allow compiling with GCC 8 and DEVELOPER=1
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 13 Jun 2019 11:49:44 +0000 (04:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Jun 2019 16:34:16 +0000 (09:34 -0700)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/poll/poll.c

index 4459408c7d0ba762b1dd4184a4c970778ba097a5..8b07edb0feca434cce2ff7766c30d7529febf996 100644 (file)
@@ -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;