detached 490ca62

internal/fakecgo: move setg and call5 out of autogenerated files (#378)

setg_trampoline and call5 function signatures don't need to live in autogenerated files,
as they don't depend on any input from gen.go.

This will make future enchancements to autogenerated code a bit easier.

Updates #343
commit
490ca620d07bdc5e5c20b515833129951039b559
author
Quim Muntal · · 2025-12-17 15:51 UTC
committer
GitHub · · 2025-12-17 15:51 UTC
parent
58d7177
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
3 files · +14 -12
A internal/fakecgo/fakecgo.go +14 -0
@@ -0,0 +1,14 @@
1+// SPDX-License-Identifier: Apache-2.0
2+// SPDX-FileCopyrightText: 2025 The Ebitengine Authors
3+
4+//go:build !cgo && (darwin || freebsd || linux || netbsd)
5+
6+package fakecgo
7+
8+import _ "unsafe"
9+
10+// setg_trampoline calls setg with the G provided
11+func setg_trampoline(setg uintptr, G uintptr)
12+
13+// call5 takes fn the C function and 5 arguments and calls the function with those arguments
14+func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr
@@ -0,0 +1,14 @@
1+// SPDX-License-Identifier: Apache-2.0
2+// SPDX-FileCopyrightText: 2025 The Ebitengine Authors
3+
4+//go:build !cgo && (darwin || freebsd || linux || netbsd)
5+
6+package fakecgo
7+
8+import _ "unsafe"
9+
10+// setg_trampoline calls setg with the G provided
11+func setg_trampoline(setg uintptr, G uintptr)
12+
13+// call5 takes fn the C function and 5 arguments and calls the function with those arguments
14+func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr
M internal/fakecgo/gen.go +0 -6
@@ -29,12 +29,6 @@ import (
2929 "unsafe"
3030 )
3131
32-// setg_trampoline calls setg with the G provided
33-func setg_trampoline(setg uintptr, G uintptr)
34-
35-// call5 takes fn the C function and 5 arguments and calls the function with those arguments
36-func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr
37-
3832 {{ range . -}}
3933 //go:nosplit
4034 //go:norace
@@ -29,12 +29,6 @@ import (
29 "unsafe"29 "unsafe"
30 )30 )
31 31
32-// setg_trampoline calls setg with the G provided
33-func setg_trampoline(setg uintptr, G uintptr)
34-
35-// call5 takes fn the C function and 5 arguments and calls the function with those arguments
36-func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr
37-
38 {{ range . -}}32 {{ range . -}}
39 //go:nosplit33 //go:nosplit
40 //go:norace34 //go:norace
M internal/fakecgo/zsymbols.go +0 -6
@@ -12,12 +12,6 @@ import (
1212 "unsafe"
1313 )
1414
15-// setg_trampoline calls setg with the G provided
16-func setg_trampoline(setg uintptr, G uintptr)
17-
18-// call5 takes fn the C function and 5 arguments and calls the function with those arguments
19-func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr
20-
2115 //go:nosplit
2216 //go:norace
2317 func malloc(size uintptr) unsafe.Pointer {
@@ -12,12 +12,6 @@ import (
12 "unsafe"12 "unsafe"
13 )13 )
14 14
15-// setg_trampoline calls setg with the G provided
16-func setg_trampoline(setg uintptr, G uintptr)
17-
18-// call5 takes fn the C function and 5 arguments and calls the function with those arguments
19-func call5(fn, a1, a2, a3, a4, a5 uintptr) uintptr
20-
21 //go:nosplit15 //go:nosplit
22 //go:norace16 //go:norace
23 func malloc(size uintptr) unsafe.Pointer {17 func malloc(size uintptr) unsafe.Pointer {

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