mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
all: use RTLD_LAZY in dlopen for darwin (#2453)
dlopen requires either RTLD_LAZY or RTLD_NOW but there was neither. Updates #1162
This commit is contained in:
parent
072e91d67f
commit
56ec19caa1
@ -50,7 +50,7 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
corefoundation = purego.Dlopen("CoreFoundation.framework/CoreFoundation", purego.RTLD_GLOBAL)
|
||||
corefoundation = purego.Dlopen("CoreFoundation.framework/CoreFoundation", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
|
||||
procCFNumberCreate = purego.Dlsym(corefoundation, "CFNumberCreate")
|
||||
procCFNumberGetValue = purego.Dlsym(corefoundation, "CFNumberGetValue")
|
||||
procCFArrayCreate = purego.Dlsym(corefoundation, "CFArrayCreate")
|
||||
|
@ -85,7 +85,7 @@ type _IOHIDElementType uint32
|
||||
type _IOHIDDeviceCallback func(context unsafe.Pointer, result _IOReturn, sender unsafe.Pointer, device _IOHIDDeviceRef)
|
||||
|
||||
var (
|
||||
iokit = purego.Dlopen("IOKit.framework/IOKit", purego.RTLD_GLOBAL)
|
||||
iokit = purego.Dlopen("IOKit.framework/IOKit", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
|
||||
|
||||
procIOHIDElementGetTypeID = purego.Dlsym(iokit, "IOHIDElementGetTypeID")
|
||||
procIOHIDManagerCreate = purego.Dlsym(iokit, "IOHIDManagerCreate")
|
||||
|
@ -49,7 +49,7 @@ type MetalLayer struct {
|
||||
}
|
||||
|
||||
var (
|
||||
coreGraphics = purego.Dlopen("/System/Library/Frameworks/CoreGraphics.framework/Versions/Current/CoreGraphics", purego.RTLD_GLOBAL)
|
||||
coreGraphics = purego.Dlopen("/System/Library/Frameworks/CoreGraphics.framework/Versions/Current/CoreGraphics", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
|
||||
_CGColorSpaceCreateWithName = purego.Dlsym(coreGraphics, "CGColorSpaceCreateWithName")
|
||||
_CGColorSpaceRelease = purego.Dlsym(coreGraphics, "CGColorSpaceRelease")
|
||||
kCGColorSpaceDisplayP3 = purego.Dlsym(coreGraphics, "kCGColorSpaceDisplayP3")
|
||||
|
@ -35,7 +35,7 @@ func init() {
|
||||
//go:cgo_import_dynamic _ _ "Metal.framework/Metal"
|
||||
|
||||
// It is also necessary for CoreGraphics to be linked
|
||||
purego.Dlopen("/System/Library/Frameworks/CoreGraphics.framework/Versions/Current/CoreGraphics", purego.RTLD_GLOBAL)
|
||||
purego.Dlopen("/System/Library/Frameworks/CoreGraphics.framework/Versions/Current/CoreGraphics", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
|
||||
}
|
||||
|
||||
func Example_listDevices() {
|
||||
|
@ -348,7 +348,7 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
metal = purego.Dlopen("Metal.framework/Metal", purego.RTLD_GLOBAL)
|
||||
metal = purego.Dlopen("Metal.framework/Metal", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
|
||||
_MTLCreateSystemDefaultDevice = purego.Dlsym(metal, "MTLCreateSystemDefaultDevice")
|
||||
)
|
||||
|
||||
|
@ -24,12 +24,12 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
opengl = purego.Dlopen("/System/Library/Frameworks/OpenGLES.framework/Versions/Current/OpenGLES", purego.RTLD_GLOBAL)
|
||||
opengl = purego.Dlopen("/System/Library/Frameworks/OpenGLES.framework/Versions/Current/OpenGLES", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
|
||||
if opengl != 0 {
|
||||
isES = true
|
||||
return
|
||||
}
|
||||
opengl = purego.Dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", purego.RTLD_GLOBAL)
|
||||
opengl = purego.Dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", purego.RTLD_LAZY|purego.RTLD_GLOBAL)
|
||||
}
|
||||
|
||||
func getProcAddress(name string) uintptr {
|
||||
|
Loading…
Reference in New Issue
Block a user