Skip to content

Commit

Permalink
Merge pull request #2149 from dscho/gcc-8-gfw
Browse files Browse the repository at this point in the history
Make Git for Windows compile with GCC 8.x
  • Loading branch information
dscho committed Apr 5, 2019
2 parents a7f813c + 77f8698 commit 61224e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compat/poll/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ win32_compute_revents (HANDLE h, int *p_sought)
case FILE_TYPE_PIPE:
if (!once_only)
{
NtQueryInformationFile = (PNtQueryInformationFile)
NtQueryInformationFile = (PNtQueryInformationFile)(void *)
GetProcAddress (GetModuleHandleA ("ntdll.dll"),
"NtQueryInformationFile");
once_only = TRUE;
Expand Down
2 changes: 1 addition & 1 deletion compat/win32/exit-process.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static int exit_process(HANDLE process, int exit_code)
HINSTANCE kernel32 = GetModuleHandleA("kernel32");
if (!kernel32)
die("BUG: cannot find kernel32");
exit_process_address = (LPTHREAD_START_ROUTINE)
exit_process_address = (LPTHREAD_START_ROUTINE)(void *)
GetProcAddress(kernel32, "ExitProcess");
initialized = 1;
}
Expand Down
8 changes: 7 additions & 1 deletion kwset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 61224e4

Please sign in to comment.