Commit 3513d840 authored by Shenghou Ma's avatar Shenghou Ma

runtime/cgo: fix compilation on Windows with CFLAGS -Wall -Werror

also fix one out-of-date comment in cmd/ld/pe.c as well.

R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/6843061
parent 7ec76e25
...@@ -659,7 +659,7 @@ asmbpe(void) ...@@ -659,7 +659,7 @@ asmbpe(void)
// for other threads we specify stack size in runtime explicitly // for other threads we specify stack size in runtime explicitly
// (runtime knows whether cgo is enabled or not). // (runtime knows whether cgo is enabled or not).
// If you change stack reserve sizes here, // If you change stack reserve sizes here,
// change them in runtime/cgo/windows_386/amd64.c as well. // change STACKSIZE in runtime/cgo/gcc_windows_{386,amd64}.c as well.
if(!iscgo) { if(!iscgo) {
set(SizeOfStackReserve, 0x00010000); set(SizeOfStackReserve, 0x00010000);
set(SizeOfStackCommit, 0x0000ffff); set(SizeOfStackCommit, 0x0000ffff);
......
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <process.h>
#include "libcgo.h" #include "libcgo.h"
static void *threadentry(void*); static void threadentry(void*);
/* 1MB is default stack size for 32-bit Windows. /* 1MB is default stack size for 32-bit Windows.
Allocation granularity on Windows is typically 64 KB. Allocation granularity on Windows is typically 64 KB.
...@@ -28,7 +29,7 @@ libcgo_sys_thread_start(ThreadStart *ts) ...@@ -28,7 +29,7 @@ libcgo_sys_thread_start(ThreadStart *ts)
_beginthread(threadentry, 0, ts); _beginthread(threadentry, 0, ts);
} }
static void* static void
threadentry(void *v) threadentry(void *v)
{ {
ThreadStart ts; ThreadStart ts;
...@@ -55,5 +56,4 @@ threadentry(void *v) ...@@ -55,5 +56,4 @@ threadentry(void *v)
crosscall_386(ts.fn); crosscall_386(ts.fn);
LocalFree(tls0); LocalFree(tls0);
return nil;
} }
...@@ -4,9 +4,10 @@ ...@@ -4,9 +4,10 @@
#define WIN64_LEAN_AND_MEAN #define WIN64_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <process.h>
#include "libcgo.h" #include "libcgo.h"
static void *threadentry(void*); static void threadentry(void*);
/* 2MB is default stack size for 64-bit Windows. /* 2MB is default stack size for 64-bit Windows.
Allocation granularity on Windows is typically 64 KB. Allocation granularity on Windows is typically 64 KB.
...@@ -28,7 +29,7 @@ libcgo_sys_thread_start(ThreadStart *ts) ...@@ -28,7 +29,7 @@ libcgo_sys_thread_start(ThreadStart *ts)
_beginthread(threadentry, 0, ts); _beginthread(threadentry, 0, ts);
} }
static void* static void
threadentry(void *v) threadentry(void *v)
{ {
ThreadStart ts; ThreadStart ts;
...@@ -53,5 +54,4 @@ threadentry(void *v) ...@@ -53,5 +54,4 @@ threadentry(void *v)
); );
crosscall_amd64(ts.fn); crosscall_amd64(ts.fn);
return nil;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment