From f3a03780a1d4737cc6d52d9fae80a5b26fc7d515 Mon Sep 17 00:00:00 2001 From: Matthew Arnold Date: Mon, 28 Sep 2020 20:01:26 +0000 Subject: [PATCH] Tweak nbdkit-1.22.3 for CDI build --- nbdkit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nbdkit.go b/nbdkit.go index fdad135..f8fac4f 100644 --- a/nbdkit.go +++ b/nbdkit.go @@ -529,7 +529,7 @@ func PluginInitialize(name string, impl PluginInterface) unsafe.Pointer { // Set up the hidden plugin fields as for C. struct_size := C.ulong(unsafe.Sizeof(plugin)) - plugin._struct_size = struct_size + plugin._struct_size = C.uint64_t(struct_size) plugin._api_version = C.NBDKIT_API_VERSION plugin._thread_model = C.NBDKIT_THREAD_MODEL_PARALLEL @@ -563,7 +563,7 @@ func PluginInitialize(name string, impl PluginInterface) unsafe.Pointer { // Return a newly malloced copy of the struct. This must be // globally available to the C code in the server, so it is // never freed. - p := (*C.struct_nbdkit_plugin)(C.malloc(struct_size)) + p := (*C.struct_nbdkit_plugin)(C.malloc(C.size_t(struct_size))) *p = plugin return unsafe.Pointer(p) }