detached 47b8ab8

internal/fakecgo: add build tags 'darwin' (#29)

This enables to build purego with `./...` for Windows.

Closes #28
commit
47b8ab81ba519c7212acad2020708056e414fbbc
author
Hajime Hoshi · · 2022-08-29 18:33 UTC
committer
GitHub · · 2022-08-29 18:33 UTC
parent
6ed67cd
signature
GPG Unverified4AEE18F83AFDEB23 The key is unknown
11 files · +33 -0
M internal/fakecgo/callbacks.go +3 -0
@@ -2,6 +2,9 @@
22 // Use of this source code is governed by a BSD-style
33 // license that can be found in the LICENSE file.
44
5+//go:build darwin
6+// +build darwin
7+
58 package fakecgo
69
710 import _ "unsafe"
@@ -2,6 +2,9 @@
2 // Use of this source code is governed by a BSD-style2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.3 // license that can be found in the LICENSE file.
4 4
5+//go:build darwin
6+// +build darwin
7+
5 package fakecgo8 package fakecgo
6 9
7 import _ "unsafe"10 import _ "unsafe"
M internal/fakecgo/doc.go +3 -0
@@ -1,6 +1,9 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4+//go:build darwin
5+// +build darwin
6+
47 // Package fakecgo implements the Cgo runtime (runtime/cgo) entirely in Go.
58 // This allows code that calls into C to function properly when CGO_ENABLED=0.
69 //
@@ -1,6 +1,9 @@
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
5+// +build darwin
6+
4 // Package fakecgo implements the Cgo runtime (runtime/cgo) entirely in Go.7 // Package fakecgo implements the Cgo runtime (runtime/cgo) entirely in Go.
5 // This allows code that calls into C to function properly when CGO_ENABLED=0.8 // This allows code that calls into C to function properly when CGO_ENABLED=0.
6 //9 //
M internal/fakecgo/go_libinit.go +3 -0
@@ -1,6 +1,9 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4+//go:build darwin
5+// +build darwin
6+
47 package fakecgo
58
69 import (
@@ -1,6 +1,9 @@
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
5+// +build darwin
6+
4 package fakecgo7 package fakecgo
5 8
6 import (9 import (
M internal/fakecgo/go_setenv.go +3 -0
@@ -1,6 +1,9 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4+//go:build darwin
5+// +build darwin
6+
47 package fakecgo
58
69 //go:nosplit
@@ -1,6 +1,9 @@
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
5+// +build darwin
6+
4 package fakecgo7 package fakecgo
5 8
6 //go:nosplit9 //go:nosplit
M internal/fakecgo/go_util.go +3 -0
@@ -1,6 +1,9 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4+//go:build darwin
5+// +build darwin
6+
47 package fakecgo
58
69 import "unsafe"
@@ -1,6 +1,9 @@
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
5+// +build darwin
6+
4 package fakecgo7 package fakecgo
5 8
6 import "unsafe"9 import "unsafe"
M internal/fakecgo/iscgo.go +3 -0
@@ -2,6 +2,9 @@
22 // Use of this source code is governed by a BSD-style
33 // license that can be found in the LICENSE file.
44
5+//go:build darwin
6+// +build darwin
7+
58 // The runtime package contains an uninitialized definition
69 // for runtime·iscgo. Override it to tell the runtime we're here.
710 // There are various function pointers that should be set too,
@@ -2,6 +2,9 @@
2 // Use of this source code is governed by a BSD-style2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.3 // license that can be found in the LICENSE file.
4 4
5+//go:build darwin
6+// +build darwin
7+
5 // The runtime package contains an uninitialized definition8 // The runtime package contains an uninitialized definition
6 // for runtime·iscgo. Override it to tell the runtime we're here.9 // for runtime·iscgo. Override it to tell the runtime we're here.
7 // There are various function pointers that should be set too,10 // There are various function pointers that should be set too,
M internal/fakecgo/libcgo.go +3 -0
@@ -1,6 +1,9 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4+//go:build darwin
5+// +build darwin
6+
47 package fakecgo
58
69 type size_t uintptr
@@ -1,6 +1,9 @@
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
5+// +build darwin
6+
4 package fakecgo7 package fakecgo
5 8
6 type size_t uintptr9 type size_t uintptr
M internal/fakecgo/setenv.go +3 -0
@@ -2,6 +2,9 @@
22 // Use of this source code is governed by a BSD-style
33 // license that can be found in the LICENSE file.
44
5+//go:build darwin
6+// +build darwin
7+
58 package fakecgo
69
710 import _ "unsafe" // for go:linkname
@@ -2,6 +2,9 @@
2 // Use of this source code is governed by a BSD-style2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.3 // license that can be found in the LICENSE file.
4 4
5+//go:build darwin
6+// +build darwin
7+
5 package fakecgo8 package fakecgo
6 9
7 import _ "unsafe" // for go:linkname10 import _ "unsafe" // for go:linkname
M internal/fakecgo/symbols.go +3 -0
@@ -1,6 +1,9 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4+//go:build darwin
5+// +build darwin
6+
47 package fakecgo
58
69 import "unsafe"
@@ -1,6 +1,9 @@
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
5+// +build darwin
6+
4 package fakecgo7 package fakecgo
5 8
6 import "unsafe"9 import "unsafe"
M internal/fakecgo/trampolines_amd64.s +3 -0
@@ -1,6 +1,9 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4+//go:build darwin
5+// +build darwin
6+
47 /*
58 trampoline for emulating required C functions for cgo in go (see cgo.go)
69 (we convert cdecl calling convention to go and vice-versa)
@@ -1,6 +1,9 @@
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
5+// +build darwin
6+
4 /*7 /*
5 trampoline for emulating required C functions for cgo in go (see cgo.go)8 trampoline for emulating required C functions for cgo in go (see cgo.go)
6 (we convert cdecl calling convention to go and vice-versa)9 (we convert cdecl calling convention to go and vice-versa)
M internal/fakecgo/trampolines_arm64.s +3 -0
@@ -1,6 +1,9 @@
11 // SPDX-License-Identifier: Apache-2.0
22 // SPDX-FileCopyrightText: 2022 The Ebitengine Authors
33
4+//go:build darwin
5+// +build darwin
6+
47 #include "textflag.h"
58 #include "go_asm.h"
69
@@ -1,6 +1,9 @@
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
5+// +build darwin
6+
4 #include "textflag.h"7 #include "textflag.h"
5 #include "go_asm.h"8 #include "go_asm.h"
6 9

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