detached 88cc579

Remove linkname on playground (#250)

Currently the playground just crashes with a nasty error. This makes it so the error message is nice. It also removes linkname usages which is also good.

Updates #247
commit
88cc57927e42f1fbd59f6523fe0eafb572985f57
author
TotallyGamerJet · · 2024-05-22 16:35 UTC
committer
GitHub · · 2024-05-22 16:35 UTC
parent
6cd1224
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
3 files · +18 -14
M dlfcn.go +1 -1
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4-//go:build darwin || freebsd || linux
4+//go:build (darwin || freebsd || linux) && !faketime
55
66 package purego
77
@@ -1,7 +1,7 @@
1 // SPDX-License-Identifier: Apache-2.01 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors2 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3 3
4-//go:build darwin || freebsd || linux4+//go:build (darwin || freebsd || linux) && !faketime
5 5
6 package purego6 package purego
7 7
M dlfcn_playground.go +16 -12
@@ -5,16 +5,20 @@
55
66 package purego
77
8-import _ "unsafe"
8+import "errors"
99
10-// The playground doesn't support dynamic linking so just stub out the addresses
11-var (
12- //go:linkname purego_dlopen purego_dlopen
13- purego_dlopen uintptr
14- //go:linkname purego_dlsym purego_dlsym
15- purego_dlsym uintptr
16- //go:linkname purego_dlerror purego_dlerror
17- purego_dlerror uintptr
18- //go:linkname purego_dlclose purego_dlclose
19- purego_dlclose uintptr
20-)
10+func Dlopen(path string, mode int) (uintptr, error) {
11+ return 0, errors.New("Dlopen is not supported in the playground")
12+}
13+
14+func Dlsym(handle uintptr, name string) (uintptr, error) {
15+ return 0, errors.New("Dlsym is not supported in the playground")
16+}
17+
18+func Dlclose(handle uintptr) error {
19+ return errors.New("Dlclose is not supported in the playground")
20+}
21+
22+func loadSymbol(handle uintptr, name string) (uintptr, error) {
23+ return Dlsym(handle, name)
24+}
@@ -5,16 +5,20 @@
5 5
6 package purego6 package purego
7 7
8-import _ "unsafe"8+import "errors"
9 9
10-// The playground doesn't support dynamic linking so just stub out the addresses10+func Dlopen(path string, mode int) (uintptr, error) {
11-var (11+ return 0, errors.New("Dlopen is not supported in the playground")
12- //go:linkname purego_dlopen purego_dlopen12+}
13- purego_dlopen uintptr13+
14- //go:linkname purego_dlsym purego_dlsym14+func Dlsym(handle uintptr, name string) (uintptr, error) {
15- purego_dlsym uintptr15+ return 0, errors.New("Dlsym is not supported in the playground")
16- //go:linkname purego_dlerror purego_dlerror16+}
17- purego_dlerror uintptr17+
18- //go:linkname purego_dlclose purego_dlclose18+func Dlclose(handle uintptr) error {
19- purego_dlclose uintptr19+ return errors.New("Dlclose is not supported in the playground")
20-)20+}
21+
22+func loadSymbol(handle uintptr, name string) (uintptr, error) {
23+ return Dlsym(handle, name)
24+}
M dlfcn_stubs.s +1 -1
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4-//go:build darwin || !cgo && (freebsd || linux)
4+//go:build darwin || !cgo && (freebsd || linux) && !faketime
55
66 #include "textflag.h"
77
@@ -1,7 +1,7 @@
1 // SPDX-License-Identifier: Apache-2.01 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors2 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
3 3
4-//go:build darwin || !cgo && (freebsd || linux)4+//go:build darwin || !cgo && (freebsd || linux) && !faketime
5 5
6 #include "textflag.h"6 #include "textflag.h"
7 7

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close