Skip to content

Commit 61224e4

Browse files
authored
Merge pull request #2149 from dscho/gcc-8-gfw
Make Git for Windows compile with GCC 8.x
2 parents a7f813c + 77f8698 commit 61224e4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
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 *)
153153
GetProcAddress (GetModuleHandleA ("ntdll.dll"),
154154
"NtQueryInformationFile");
155155
once_only = TRUE;

compat/win32/exit-process.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int exit_process(HANDLE process, int exit_code)
130130
HINSTANCE kernel32 = GetModuleHandleA("kernel32");
131131
if (!kernel32)
132132
die("BUG: cannot find kernel32");
133-
exit_process_address = (LPTHREAD_START_ROUTINE)
133+
exit_process_address = (LPTHREAD_START_ROUTINE)(void *)
134134
GetProcAddress(kernel32, "ExitProcess");
135135
initialized = 1;
136136
}

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)