1
0
mirror of https://github.com/golang/go synced 2024-10-02 20:31:21 -06: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\
util.o\
ifeq ($(GOOS),windows)
CGO_LDFLAGS=-lm -mthreads
else
CGO_LDFLAGS=-lpthread
CGO_OFILES+=setenv.o\
endif
OFILES=\
iscgo.$O\
callbacks.$O\
_cgo_import.$O\
$(CGO_OFILES)\
ifeq ($(GOOS),windows)
CGO_LDFLAGS=-lm -mthreads
else
CGO_LDFLAGS=-lpthread
endif
ifeq ($(GOOS),freebsd)
OFILES+=\
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 <stdlib.h>
/* Stub for calling malloc from Go */
static void
x_cgo_malloc(void *p)
@ -51,12 +49,3 @@ xlibcgo_thread_start(ThreadStart *arg)
}
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;