dynlib: unload library before loading again & add LIBRARY_FILE_EXTENSION constant

This commit is contained in:
Laytan Laats
2024-12-01 11:54:56 +11:00
committed by flysand7
parent 47888794c8
commit e6a9f93e9f
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 {