Skip to content

Commit a61fe48

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Merge pull request #2149 from dscho/gcc-8-gfw
Make Git for Windows compile with GCC 8.x
2 parents 99c5dca + c715967 commit a61fe48

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

compat/poll/poll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ win32_compute_revents (HANDLE h, int *p_sought)
149149
case FILE_TYPE_PIPE:
150150
if (!once_only)
151151
{
152-
NtQueryInformationFile = (PNtQueryInformationFile)
152+
NtQueryInformationFile = (PNtQueryInformationFile)(void (*)(void))
153153
GetProcAddress (GetModuleHandleW (L"ntdll.dll"),
154154
"NtQueryInformationFile");
155155
once_only = TRUE;

kwset.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@
3838
#include "compat/obstack.h"
3939

4040
#define NCHAR (UCHAR_MAX + 1)
41-
#define obstack_chunk_alloc xmalloc
41+
/* adapter for `xmalloc()`, which takes `size_t`, not `long` */
42+
static void *obstack_chunk_alloc(long size)
43+
{
44+
if (size < 0)
45+
BUG("Cannot allocate a negative amount: %ld", size);
46+
return xmalloc(size);
47+
}
4248
#define obstack_chunk_free free
4349

4450
#define U(c) ((unsigned char) (c))

0 commit comments

Comments
 (0)