mirror of
https://github.com/golang/go
synced 2024-11-24 11:00:08 -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:
parent
c783e68ff5
commit
6876ad37f3
@ -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\
|
||||
|
16
src/pkg/runtime/cgo/setenv.c
Normal file
16
src/pkg/runtime/cgo/setenv.c
Normal 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;
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user