Merge pull request #2149 from dscho/gcc-8-gfw

Make Git for Windows compile with GCC 8.x
This commit is contained in:
Johannes Schindelin
2019-04-05 20:26:09 +02:00
committed by Johannes Schindelin
2 changed files with 8 additions and 2 deletions

View 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 (GetModuleHandleA ("ntdll.dll"),
"NtQueryInformationFile");
once_only = TRUE;

View File

@@ -38,7 +38,13 @@
#include "compat/obstack.h"
#define NCHAR (UCHAR_MAX + 1)
#define obstack_chunk_alloc xmalloc
/* adapter for `xmalloc()`, which takes `size_t`, not `long` */
static void *obstack_chunk_alloc(long size)
{
if (size < 0)
BUG("Cannot allocate a negative amount: %ld", size);
return xmalloc(size);
}
#define obstack_chunk_free free
#define U(c) ((unsigned char) (c))