mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-01-23 02:34:42 +00:00
Panic when dlib functions are missing
This commit is contained in:
parent
4aaeda3fbb
commit
535e725618
1 changed files with 5 additions and 1 deletions
|
|
@ -19,7 +19,11 @@ import "C"
|
|||
func loadFunction(handle unsafe.Pointer, name string) unsafe.Pointer {
|
||||
cs := C.CString(name)
|
||||
defer C.free(unsafe.Pointer(cs))
|
||||
return C.dlsym(handle, cs)
|
||||
ptr := C.dlsym(handle, cs)
|
||||
if ptr == nil {
|
||||
panic("lib function not found: " + name)
|
||||
}
|
||||
return ptr
|
||||
}
|
||||
|
||||
func loadLib(filepath string) (handle unsafe.Pointer, err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue