mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Remember kids, always test your code. There was a variable name colission in dlsym D:
This commit is contained in:
+3
-2
@@ -1,4 +1,5 @@
|
|||||||
#import "fmt.odin";
|
#import "fmt.odin";
|
||||||
|
#import "strings.odin";
|
||||||
|
|
||||||
Handle :: i32;
|
Handle :: i32;
|
||||||
File_Time :: u64;
|
File_Time :: u64;
|
||||||
@@ -197,9 +198,9 @@ dlopen :: proc(filename: string, flags: int) -> rawptr #inline {
|
|||||||
dlsym :: proc(handle: rawptr, symbol: string) -> (proc() #cc_c) #inline {
|
dlsym :: proc(handle: rawptr, symbol: string) -> (proc() #cc_c) #inline {
|
||||||
assert(handle != nil);
|
assert(handle != nil);
|
||||||
cstr := strings.new_c_string(symbol);
|
cstr := strings.new_c_string(symbol);
|
||||||
handle := unix_dlsym(handle, cstr);
|
proc_handle := unix_dlsym(handle, cstr);
|
||||||
free(cstr);
|
free(cstr);
|
||||||
return handle;
|
return proc_handle;
|
||||||
}
|
}
|
||||||
dlclose :: proc(handle: rawptr) -> bool #inline {
|
dlclose :: proc(handle: rawptr) -> bool #inline {
|
||||||
assert(handle != nil);
|
assert(handle != nil);
|
||||||
|
|||||||
+2
-2
@@ -201,9 +201,9 @@ dlopen :: proc(filename: string, flags: int) -> rawptr #inline {
|
|||||||
dlsym :: proc(handle: rawptr, symbol: string) -> (proc() #cc_c) #inline {
|
dlsym :: proc(handle: rawptr, symbol: string) -> (proc() #cc_c) #inline {
|
||||||
assert(handle != nil);
|
assert(handle != nil);
|
||||||
cstr := strings.new_c_string(symbol);
|
cstr := strings.new_c_string(symbol);
|
||||||
handle := unix_dlsym(handle, cstr);
|
proc_handle := unix_dlsym(handle, cstr);
|
||||||
free(cstr);
|
free(cstr);
|
||||||
return handle;
|
return proc_handle;
|
||||||
}
|
}
|
||||||
dlclose :: proc(handle: rawptr) -> bool #inline {
|
dlclose :: proc(handle: rawptr) -> bool #inline {
|
||||||
assert(handle != nil);
|
assert(handle != nil);
|
||||||
|
|||||||
Reference in New Issue
Block a user