purego: Fix for darwin (#200)
Closes #201
- commit
- 886e3a0b044aa5151f58e2c130a677fd9bb8f060
- author
- TotallyGamerJet · · 2024-01-18 14:35 UTC
- committer
- GitHub · · 2024-01-18 14:35 UTC
- parent
- d2ab45a
- signature
- GPG Unverified
B5690EEEBB952194The key is unknown
5 files · +18 -13
M dlfcn_darwin.go +10 -0
| @@ -12,3 +12,13 @@ const ( | |||
| 12 | 12 | RTLD_LOCAL = 0x4 // All symbols are not made available for relocation processing by other modules. | |
| 13 | 13 | RTLD_GLOBAL = 0x8 // All symbols are available for relocation processing of other modules. | |
| 14 | 14 | ) | |
| 15 | + | ||
| 16 | + | //go:cgo_import_dynamic purego_dlopen dlopen "/usr/lib/libSystem.B.dylib" | |
| 17 | + | //go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib" | |
| 18 | + | //go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib" | |
| 19 | + | //go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib" | |
| 20 | + | ||
| 21 | + | //go:cgo_import_dynamic purego_dlopen dlopen "/usr/lib/libSystem.B.dylib" | |
| 22 | + | //go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib" | |
| 23 | + | //go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib" | |
| 24 | + | //go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib" | |
| @@ -12,3 +12,13 @@ const ( | |||||
| 12 | RTLD_LOCAL = 0x4 // All symbols are not made available for relocation processing by other modules. | 12 | RTLD_LOCAL = 0x4 // All symbols are not made available for relocation processing by other modules. | ||
| 13 | RTLD_GLOBAL = 0x8 // All symbols are available for relocation processing of other modules. | 13 | RTLD_GLOBAL = 0x8 // All symbols are available for relocation processing of other modules. | ||
| 14 | ) | 14 | ) | ||
| 15 | + | ||||
| 16 | + | //go:cgo_import_dynamic purego_dlopen dlopen "/usr/lib/libSystem.B.dylib" | |||
| 17 | + | //go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib" | |||
| 18 | + | //go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib" | |||
| 19 | + | //go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib" | |||
| 20 | + | ||||
| 21 | + | //go:cgo_import_dynamic purego_dlopen dlopen "/usr/lib/libSystem.B.dylib" | |||
| 22 | + | //go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib" | |||
| 23 | + | //go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib" | |||
| 24 | + | //go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib" | |||
D dlfcn_nocgo_darwin.go +0 -11
| @@ -1,11 +0,0 @@ | |||
| 1 | - | // SPDX-License-Identifier: Apache-2.0 | |
| 2 | - | // SPDX-FileCopyrightText: 2024 The Ebitengine Authors | |
| 3 | - | ||
| 4 | - | //go:build !cgo | |
| 5 | - | ||
| 6 | - | package purego | |
| 7 | - | ||
| 8 | - | //go:cgo_import_dynamic purego_dlopen dlopen "/usr/lib/libSystem.B.dylib" | |
| 9 | - | //go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib" | |
| 10 | - | //go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib" | |
| 11 | - | //go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib" | |
| @@ -1,11 +0,0 @@ | |||||
| 1 | - | // SPDX-License-Identifier: Apache-2.0 | |||
| 2 | - | // SPDX-FileCopyrightText: 2024 The Ebitengine Authors | |||
| 3 | - | ||||
| 4 | - | //go:build !cgo | |||
| 5 | - | ||||
| 6 | - | package purego | |||
| 7 | - | ||||
| 8 | - | //go:cgo_import_dynamic purego_dlopen dlopen "/usr/lib/libSystem.B.dylib" | |||
| 9 | - | //go:cgo_import_dynamic purego_dlsym dlsym "/usr/lib/libSystem.B.dylib" | |||
| 10 | - | //go:cgo_import_dynamic purego_dlerror dlerror "/usr/lib/libSystem.B.dylib" | |||
| 11 | - | //go:cgo_import_dynamic purego_dlclose dlclose "/usr/lib/libSystem.B.dylib" | |||
M dlfcn_stubs.s +1 -1
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | // SPDX-License-Identifier: Apache-2.0 | |
| 2 | 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors | |
| 3 | 3 | ||
| 4 | - | //go:build !cgo && (darwin || freebsd || linux) | |
| 4 | + | //go:build darwin || !cgo && (freebsd || linux) | |
| 5 | 5 | ||
| 6 | 6 | #include "textflag.h" | |
| 7 | 7 | ||
| @@ -1,7 +1,7 @@ | |||||
| 1 | // SPDX-License-Identifier: Apache-2.0 | 1 | // SPDX-License-Identifier: Apache-2.0 | ||
| 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors | 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors | ||
| 3 | 3 | ||||
| 4 | - | //go:build !cgo && (darwin || freebsd || linux) | 4 | + | //go:build darwin || !cgo && (freebsd || linux) |
| 5 | 5 | ||||
| 6 | #include "textflag.h" | 6 | #include "textflag.h" | ||
| 7 | 7 | ||||
M internal/cgo/dlfcn_cgo_unix.go +1 -1
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | // SPDX-License-Identifier: Apache-2.0 | |
| 2 | 2 | // SPDX-FileCopyrightText: 2024 The Ebitengine Authors | |
| 3 | 3 | ||
| 4 | - | //go:build darwin || freebsd || linux | |
| 4 | + | //go:build freebsd || linux | |
| 5 | 5 | ||
| 6 | 6 | package cgo | |
| 7 | 7 | ||
| @@ -1,7 +1,7 @@ | |||||
| 1 | // SPDX-License-Identifier: Apache-2.0 | 1 | // SPDX-License-Identifier: Apache-2.0 | ||
| 2 | // SPDX-FileCopyrightText: 2024 The Ebitengine Authors | 2 | // SPDX-FileCopyrightText: 2024 The Ebitengine Authors | ||
| 3 | 3 | ||||
| 4 | - | //go:build darwin || freebsd || linux | 4 | + | //go:build freebsd || linux |
| 5 | 5 | ||||
| 6 | package cgo | 6 | package cgo | ||
| 7 | 7 | ||||
A internal/cgo/empty.go +6 -0
| @@ -0,0 +1,6 @@ | |||
| 1 | + | // SPDX-License-Identifier: Apache-2.0 | |
| 2 | + | // SPDX-FileCopyrightText: 2024 The Ebitengine Authors | |
| 3 | + | ||
| 4 | + | package cgo | |
| 5 | + | ||
| 6 | + | // Empty so that importing this package doesn't cause issue for certain platforms. | |
| @@ -0,0 +1,6 @@ | |||||
| 1 | + | // SPDX-License-Identifier: Apache-2.0 | |||
| 2 | + | // SPDX-FileCopyrightText: 2024 The Ebitengine Authors | |||
| 3 | + | ||||
| 4 | + | package cgo | |||
| 5 | + | ||||
| 6 | + | // Empty so that importing this package doesn't cause issue for certain platforms. | |||