]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/cgo: fix compilation on Windows with CFLAGS -Wall -Werror
authorShenghou Ma <minux.ma@gmail.com>
Sat, 17 Nov 2012 18:06:08 +0000 (02:06 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Sat, 17 Nov 2012 18:06:08 +0000 (02:06 +0800)
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

src/cmd/ld/pe.c
src/pkg/runtime/cgo/gcc_windows_386.c
src/pkg/runtime/cgo/gcc_windows_amd64.c

index e69f34783dd57127f1d3f365352a92e83f0efbd3..d263562aec6ae3708f401125f5ef7e229384412b 100644 (file)
@@ -659,7 +659,7 @@ asmbpe(void)
        // for other threads we specify stack size in runtime explicitly
        // (runtime knows whether cgo is enabled or not).
        // 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) {
                set(SizeOfStackReserve, 0x00010000);
                set(SizeOfStackCommit, 0x0000ffff);
index 2b940d3622a037874dfad0b0a7fc2656d6a58cb9..38ca730675c35c19c709debba92f14e59cc0ad65 100644 (file)
@@ -4,9 +4,10 @@
 
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
+#include <process.h>
 #include "libcgo.h"
 
-static void *threadentry(void*);
+static void threadentry(void*);
 
 /* 1MB is default stack size for 32-bit Windows.
    Allocation granularity on Windows is typically 64 KB.
@@ -28,7 +29,7 @@ libcgo_sys_thread_start(ThreadStart *ts)
        _beginthread(threadentry, 0, ts);
 }
 
-static void*
+static void
 threadentry(void *v)
 {
        ThreadStart ts;
@@ -55,5 +56,4 @@ threadentry(void *v)
        crosscall_386(ts.fn);
        
        LocalFree(tls0);
-       return nil;
 }
index 0d2f5d233bef34446a176faee24a88d2cc1b4ada..cf1895cfbc6a57aed5e24ca16b45f59de4c1d000 100644 (file)
@@ -4,9 +4,10 @@
 
 #define WIN64_LEAN_AND_MEAN
 #include <windows.h>
+#include <process.h>
 #include "libcgo.h"
 
-static void *threadentry(void*);
+static void threadentry(void*);
 
 /* 2MB is default stack size for 64-bit Windows.
    Allocation granularity on Windows is typically 64 KB.
@@ -28,7 +29,7 @@ libcgo_sys_thread_start(ThreadStart *ts)
        _beginthread(threadentry, 0, ts);
 }
 
-static void*
+static void
 threadentry(void *v)
 {
        ThreadStart ts;
@@ -53,5 +54,4 @@ threadentry(void *v)
        );
 
        crosscall_amd64(ts.fn);
-       return nil;
 }