aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-01-27 15:58:52 -0500
committerRuss Cox <rsc@golang.org>2016-01-27 21:12:30 +0000
commite3f3f940a09ee99e952be43fd3b19c969cf229d0 (patch)
tree6d83aaa2db43876cc0d372b1979195ab10c8d8ba
parent572f7660a774ebd8552408a6058b36cc90f6f563 (diff)
downloadgo-e3f3f940a09ee99e952be43fd3b19c969cf229d0.tar.gz
go-e3f3f940a09ee99e952be43fd3b19c969cf229d0.zip
runtime/cgo: add cgo build tag to C files
This makes "CGO_ENABLED=0 go list runtime/cgo" work, which fixes the current cmd/go test failure. Change-Id: Ia55ce3ba1dbb09f618ae5f4c8547722670360f59 Reviewed-on: https://go-review.googlesource.com/19001 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-rw-r--r--src/runtime/cgo/gcc_darwin_amd64.c2
-rw-r--r--src/runtime/cgo/gcc_libinit.c1
-rw-r--r--src/runtime/cgo/gcc_setenv.c1
-rw-r--r--src/runtime/cgo/gcc_util.c2
4 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/cgo/gcc_darwin_amd64.c b/src/runtime/cgo/gcc_darwin_amd64.c
index dc679acab9..b70c83345f 100644
--- a/src/runtime/cgo/gcc_darwin_amd64.c
+++ b/src/runtime/cgo/gcc_darwin_amd64.c
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build cgo
+
#include <string.h> /* for strerror */
#include <pthread.h>
#include <signal.h>
diff --git a/src/runtime/cgo/gcc_libinit.c b/src/runtime/cgo/gcc_libinit.c
index c3e94f58d2..5b9558aabc 100644
--- a/src/runtime/cgo/gcc_libinit.c
+++ b/src/runtime/cgo/gcc_libinit.c
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build cgo
// +build darwin dragonfly freebsd linux netbsd solaris
// +build !ppc64,!ppc64le
diff --git a/src/runtime/cgo/gcc_setenv.c b/src/runtime/cgo/gcc_setenv.c
index ca29dcb05f..c976ac3d37 100644
--- a/src/runtime/cgo/gcc_setenv.c
+++ b/src/runtime/cgo/gcc_setenv.c
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build cgo
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
#include "libcgo.h"
diff --git a/src/runtime/cgo/gcc_util.c b/src/runtime/cgo/gcc_util.c
index 143734e94b..d5efec396b 100644
--- a/src/runtime/cgo/gcc_util.c
+++ b/src/runtime/cgo/gcc_util.c
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+// +build cgo
+
#include "libcgo.h"
/* Stub for calling malloc from Go */