aboutsummaryrefslogtreecommitdiff
path: root/Lib/go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2014-09-25 12:10:11 -0700
committerIan Lance Taylor <iant@google.com>2014-09-25 12:10:11 -0700
commit4b64ce71a365d6734ca54673300d44d0d597762c (patch)
tree1c10668b3ddcb040139d7c5dd48dd3d5ced58aa0 /Lib/go
parentde6b433cb178c2e4b7b2f3c7dfc02a90ddedfccf (diff)
downloadswig-4b64ce71a365d6734ca54673300d44d0d597762c.tar.gz
[Go] Adjust generated code to work with upcoming Go 1.4 release.
Diffstat (limited to 'Lib/go')
-rw-r--r--Lib/go/goruntime.swg23
1 files changed, 18 insertions, 5 deletions
diff --git a/Lib/go/goruntime.swg b/Lib/go/goruntime.swg
index bbc602b0d..a61837074 100644
--- a/Lib/go/goruntime.swg
+++ b/Lib/go/goruntime.swg
@@ -57,12 +57,21 @@ swiggo_size_assert(double, 8)
extern "C" {
#endif
extern void crosscall2(void (*fn)(void *, int), void *, int);
+extern char* _cgo_topofstack(void) __attribute__ ((weak));
extern void _cgo_allocate(void *, int);
extern void _cgo_panic(void *, int);
#ifdef __cplusplus
}
#endif
+static char *_swig_topofstack() {
+ if (_cgo_topofstack) {
+ return _cgo_topofstack();
+ } else {
+ return 0;
+ }
+}
+
static void *_swig_goallocate(size_t len) {
struct {
size_t len;
@@ -89,11 +98,11 @@ static void _swig_gopanic(const char *p) {
#include "runtime.h"
#include "cgocall.h"
-#ifdef _64BIT
-#define SWIG_PARM_SIZE 8
-#else
-#define SWIG_PARM_SIZE 4
-#endif
+#pragma dataflag 16
+static void *cgocall = runtime·cgocall;
+#pragma dataflag 16
+void *·_cgo_runtime_cgocall = &cgocall;
+
%}
#else
@@ -194,6 +203,10 @@ static _gostring_ _swig_makegostring(const char *p, size_t l) {
%go_import("unsafe", _ "runtime/cgo")
+%insert(go_header) %{
+var _cgo_runtime_cgocall func(unsafe.Pointer, uintptr)
+%}
+
#else
%go_import("syscall", "unsafe")