]> Cypherpunks repositories - gostls13.git/commitdiff
Revert "misc/cgo/testso: add test for fixed issue 4339"
authorAlex Brainman <alex.brainman@gmail.com>
Tue, 7 Apr 2015 11:42:45 +0000 (11:42 +0000)
committerAlex Brainman <alex.brainman@gmail.com>
Tue, 7 Apr 2015 11:50:28 +0000 (11:50 +0000)
This reverts commit 9fa9f966e99eb514f9b6f61821f83d5f9178a4a2.

The change has broken darwin and netbsd builders. It needs to be tested properly.

Change-Id: Id9e2d30caa8764c362c9f33890015dfc1aae0dab
Reviewed-on: https://go-review.googlesource.com/8527
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
misc/cgo/testso/cgoso.c
misc/cgo/testso/cgoso.go
misc/cgo/testso/cgoso_c.c
misc/cgo/testso/cgoso_c.h [deleted file]
misc/cgo/testso/test.bat

index 5882b4a7bec36d8819f5604d00b0ba5709727eac..917f472d3684bc9f7bd90ea0ab28150027291161 100644 (file)
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#include "cgoso_c.h"
 #include "_cgo_export.h"
 
 #ifdef WIN32
@@ -13,7 +12,3 @@ void init() {
 #else
 void init() {}
 #endif
-
-const char* getVar() {
-    return exported_var;
-}
index 36f1dcdad2c731e368c3e4436f9bb18a70caa1bc..ba6218348cab5271569801700e521b6881284c5d 100644 (file)
@@ -5,7 +5,6 @@
 package cgosotest
 
 /*
-#cgo windows CFLAGS: -DIMPORT_DLL
 // intentionally write the same LDFLAGS differently
 // to test correct handling of LDFLAGS.
 #cgo linux LDFLAGS: -L. -lcgosotest
@@ -16,32 +15,14 @@ package cgosotest
 #cgo darwin LDFLAGS: -L. libcgosotest.dylib
 #cgo windows LDFLAGS: -L. libcgosotest.dll
 
-#include "cgoso_c.h"
-
 void init(void);
 void sofunc(void);
-const char* getVar(void);
 */
 import "C"
 
-import "fmt"
-
 func Test() {
        C.init()
        C.sofunc()
-       testExportedVar()
-}
-
-func testExportedVar() {
-       const want = "Hello world"
-       got := C.GoString(C.getVar())
-       if got != want {
-               panic(fmt.Sprintf("testExportedVar: got %q, but want %q", got, want))
-       }
-       got = C.GoString(C.exported_var)
-       if got != want {
-               panic(fmt.Sprintf("testExportedVar: got %q, but want %q", got, want))
-       }
 }
 
 //export goCallback
index 9c4538498e985e2b4292c456edcc87539950b90c..7a38022b54736e1c51b48d36b48323c4ea6ecd2a 100644 (file)
@@ -4,8 +4,6 @@
 
 // +build ignore
 
-#include "cgoso_c.h"
-
 #ifdef WIN32
 // A Windows DLL is unable to call an arbitrary function in
 // the main executable. Work around that by making the main
@@ -30,5 +28,3 @@ void sofunc(void)
 {
        goCallback();
 }
-
-const char *exported_var = "Hello world";
diff --git a/misc/cgo/testso/cgoso_c.h b/misc/cgo/testso/cgoso_c.h
deleted file mode 100644 (file)
index 45073c6..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2011 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.
-
-// +build ignore
-
-#ifdef WIN32
-#if defined(EXPORT_DLL)
-#    define VAR __declspec(dllexport)
-#elif defined(IMPORT_DLL)
-#    define VAR __declspec(dllimport)
-#endif
-#else
-#    define VAR
-#endif
-
-VAR const char *exported_var;
index a5d19dee6fb6684998cb276179bee99ade681d53..7bbabea6b9cff7b3511541eec0c2588851b6275b 100644 (file)
@@ -4,7 +4,7 @@
 
 @echo off
 
-gcc -c cgoso_c.c -DEXPORT_DLL
+gcc -c cgoso_c.c
 gcc -shared -o libcgosotest.dll cgoso_c.o
 if not exist libcgosotest.dll goto fail
 go build main.go