From b0e225ac2dd1d06e078941771ac5d239671411c1 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 19 Mar 2021 23:27:14 +0200 Subject: [PATCH] dl: fix `v -cflags "-Werror" use_test.v` --- cmd/tools/vtest-self.v | 2 -- vlib/dl/dl_nix.c.v | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cmd/tools/vtest-self.v b/cmd/tools/vtest-self.v index 03499c5eaa..d1957b220e 100644 --- a/cmd/tools/vtest-self.v +++ b/cmd/tools/vtest-self.v @@ -35,8 +35,6 @@ const ( skip_with_werror = [ 'vlib/sync/array_rlock_test.v', 'vlib/clipboard/clipboard_test.v', - 'vlib/dl/dl_test.v', - 'vlib/dl/example/use_test.v', 'vlib/eventbus/eventbus_test.v', 'vlib/gx/color_test.v', 'vlib/json/json_test.v', diff --git a/vlib/dl/dl_nix.c.v b/vlib/dl/dl_nix.c.v index d373ddc2e9..0c55940f1f 100644 --- a/vlib/dl/dl_nix.c.v +++ b/vlib/dl/dl_nix.c.v @@ -15,7 +15,7 @@ fn C.dlclose(handle voidptr) int // open loads the dynamic shared object. pub fn open(filename string, flags int) voidptr { - return C.dlopen(filename.str, flags) + return C.dlopen(charptr(filename.str), flags) } // close frees a given shared object. @@ -25,5 +25,5 @@ pub fn close(handle voidptr) bool { // sym returns an address of a symbol in a given shared object. pub fn sym(handle voidptr, symbol string) voidptr { - return C.dlsym(handle, symbol.str) + return C.dlsym(handle, charptr(symbol.str)) }