From 809662459dcd2cbe0b42f338413b88fea0483086 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 26 Aug 2018 13:18:53 -0400 Subject: [PATCH] Migrate the link_darwin_amd64.go and control.go files back; fixed up errors in the C files and util.go. --- BBB_GOFILES/control.go => control.go | 2 +- BBB_GOFILES/link_darwin_amd64.go => link_darwin_amd64.go | 0 pkgui.c | 2 +- pkgui.h | 2 +- util.go | 1 + 5 files changed, 4 insertions(+), 3 deletions(-) rename BBB_GOFILES/control.go => control.go (99%) rename BBB_GOFILES/link_darwin_amd64.go => link_darwin_amd64.go (100%) diff --git a/BBB_GOFILES/control.go b/control.go similarity index 99% rename from BBB_GOFILES/control.go rename to control.go index 23a8ddf..ab8673c 100644 --- a/BBB_GOFILES/control.go +++ b/control.go @@ -6,7 +6,7 @@ import ( "unsafe" ) -// #include "ui.h" +// #include "pkgui.h" import "C" // no need to lock this; only the GUI thread can access it diff --git a/BBB_GOFILES/link_darwin_amd64.go b/link_darwin_amd64.go similarity index 100% rename from BBB_GOFILES/link_darwin_amd64.go rename to link_darwin_amd64.go diff --git a/pkgui.c b/pkgui.c index 7caab2c..586f5e9 100644 --- a/pkgui.c +++ b/pkgui.c @@ -1,6 +1,6 @@ // 26 august 2018 #include "pkgui.h" -#include "xxxxx" +#include "_cgo_export.h" uiInitOptions *pkguiAllocInitOptions(void) { diff --git a/pkgui.h b/pkgui.h index 2af5f2b..9aaa394 100644 --- a/pkgui.h +++ b/pkgui.h @@ -1,5 +1,5 @@ // 12 august 2018 -#include +#include #include "ui.h" // main.go diff --git a/util.go b/util.go index 667f679..e7fb937 100644 --- a/util.go +++ b/util.go @@ -12,6 +12,7 @@ import "C" //export pkguiAlloc func pkguiAlloc(n C.size_t) unsafe.Pointer { // cgo turns C.malloc() into a panic-on-OOM version; use it + // TODO make sure it zero-initializes too return C.malloc(n) }