1
0
mirror of https://github.com/golang/go synced 2024-11-20 00:44:45 -07:00

runtime: maybe fix Windows build broken by cgo setenv CL

R=rsc
CC=golang-dev
https://golang.org/cl/4428078
This commit is contained in:
Brad Fitzpatrick 2011-05-02 13:35:28 -07:00
parent c783e68ff5
commit 6876ad37f3
3 changed files with 24 additions and 17 deletions

View File

@ -28,18 +28,20 @@ CGO_OFILES=\
$(GOOS)_$(GOARCH).o\ $(GOOS)_$(GOARCH).o\
util.o\ util.o\
ifeq ($(GOOS),windows)
CGO_LDFLAGS=-lm -mthreads
else
CGO_LDFLAGS=-lpthread
CGO_OFILES+=setenv.o\
endif
OFILES=\ OFILES=\
iscgo.$O\ iscgo.$O\
callbacks.$O\ callbacks.$O\
_cgo_import.$O\ _cgo_import.$O\
$(CGO_OFILES)\ $(CGO_OFILES)\
ifeq ($(GOOS),windows)
CGO_LDFLAGS=-lm -mthreads
else
CGO_LDFLAGS=-lpthread
endif
ifeq ($(GOOS),freebsd) ifeq ($(GOOS),freebsd)
OFILES+=\ OFILES+=\
freebsd.$O\ freebsd.$O\

View File

@ -0,0 +1,16 @@
// Copyright 20111 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include "libcgo.h"
#include <stdlib.h>
/* Stub for calling setenv */
static void
xlibcgo_setenv(char **arg)
{
setenv(arg[0], arg[1], 1);
}
void (*libcgo_setenv)(char**) = xlibcgo_setenv;

View File

@ -4,8 +4,6 @@
#include "libcgo.h" #include "libcgo.h"
#include <stdlib.h>
/* Stub for calling malloc from Go */ /* Stub for calling malloc from Go */
static void static void
x_cgo_malloc(void *p) x_cgo_malloc(void *p)
@ -51,12 +49,3 @@ xlibcgo_thread_start(ThreadStart *arg)
} }
void (*libcgo_thread_start)(ThreadStart*) = xlibcgo_thread_start; void (*libcgo_thread_start)(ThreadStart*) = xlibcgo_thread_start;
/* Stub for calling setenv */
static void
xlibcgo_setenv(char **arg)
{
setenv(arg[0], arg[1], 1);
}
void (*libcgo_setenv)(char**) = xlibcgo_setenv;