dynlib: unload library before loading again & add LIBRARY_FILE_EXTENSION constant

This commit is contained in:
Laytan Laats
2024-11-28 21:08:08 +01:00
parent 276928170c
commit 1cece52359
5 changed files with 39 additions and 21 deletions
+2
View File
@@ -7,6 +7,8 @@ import "base:runtime"
import "core:strings"
import "core:sys/posix"
_LIBRARY_FILE_EXTENSION :: "dylib" when ODIN_OS == .Darwin else "so"
_load_library :: proc(path: string, global_symbols: bool, allocator: runtime.Allocator) -> (Library, bool) {
flags := posix.RTLD_Flags{.NOW}
if global_symbols {