aboutsummaryrefslogtreecommitdiff
path: root/src/net/internal
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/internal')
-rw-r--r--src/net/internal/cgotest/empty_test.go13
-rw-r--r--src/net/internal/cgotest/resstate.go21
2 files changed, 34 insertions, 0 deletions
diff --git a/src/net/internal/cgotest/empty_test.go b/src/net/internal/cgotest/empty_test.go
new file mode 100644
index 0000000000..c4f601d571
--- /dev/null
+++ b/src/net/internal/cgotest/empty_test.go
@@ -0,0 +1,13 @@
+// Copyright 2023 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.
+
+package cgotest
+
+import "testing"
+
+// Nothing to test here.
+// The test is that the package compiles at all.
+// See resstate.go.
+func Test(t *testing.T) {
+}
diff --git a/src/net/internal/cgotest/resstate.go b/src/net/internal/cgotest/resstate.go
new file mode 100644
index 0000000000..1b4871109e
--- /dev/null
+++ b/src/net/internal/cgotest/resstate.go
@@ -0,0 +1,21 @@
+// Copyright 2023 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.
+
+//go:build cgo && darwin
+
+package cgotest
+
+/*
+#include <resolv.h>
+*/
+import "C"
+
+import (
+ "internal/syscall/unix"
+ "unsafe"
+)
+
+// This will cause a compile error when the size of
+// unix.ResState is too small.
+type _ [unsafe.Sizeof(unix.ResState{}) - unsafe.Sizeof(C.struct___res_state{})]byte