Remember kids, always test your code. There was a variable name colission in dlsym D:

This commit is contained in:
Zac Pierson
2017-03-21 14:57:09 -05:00
parent f541dd40db
commit 690c682847
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
#import "fmt.odin";
#import "strings.odin";
Handle :: i32;
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 {
assert(handle != nil);
cstr := strings.new_c_string(symbol);
handle := unix_dlsym(handle, cstr);
proc_handle := unix_dlsym(handle, cstr);
free(cstr);
return handle;
return proc_handle;
}
dlclose :: proc(handle: rawptr) -> bool #inline {
assert(handle != nil);
+2 -2
View File
@@ -201,9 +201,9 @@ dlopen :: proc(filename: string, flags: int) -> rawptr #inline {
dlsym :: proc(handle: rawptr, symbol: string) -> (proc() #cc_c) #inline {
assert(handle != nil);
cstr := strings.new_c_string(symbol);
handle := unix_dlsym(handle, cstr);
proc_handle := unix_dlsym(handle, cstr);
free(cstr);
return handle;
return proc_handle;
}
dlclose :: proc(handle: rawptr) -> bool #inline {
assert(handle != nil);