Skip to content

Commit

Permalink
Revert "no cgo everything in fakecgo"
Browse files Browse the repository at this point in the history
This reverts commit 3adbdc7.
  • Loading branch information
TotallyGamerJet committed Apr 28, 2024
1 parent ce45caf commit 7af1ebf
Show file tree
Hide file tree
Showing 25 changed files with 15 additions and 41 deletions.
2 changes: 1 addition & 1 deletion internal/fakecgo/callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

package fakecgo

Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/doc.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

// Package fakecgo implements the Cgo runtime (runtime/cgo) entirely in Go.
// This allows code that calls into C to function properly when CGO_ENABLED=0.
Expand Down
6 changes: 2 additions & 4 deletions internal/fakecgo/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const templateSymbols = `// Code generated by 'go generate' with gen.go. DO NOT
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux
package fakecgo
Expand Down Expand Up @@ -88,7 +88,7 @@ const templateTrampolinesStubs = `// Code generated by 'go generate' with gen.go
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux
#include "textflag.h"
Expand All @@ -105,8 +105,6 @@ const templateSymbolsGoos = `// Code generated by 'go generate' with gen.go. DO
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors
//go:build !cgo
package fakecgo
{{- range $location := . }}
Expand Down
2 changes: 0 additions & 2 deletions internal/fakecgo/go_darwin_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cgo

package fakecgo

import "unsafe"
Expand Down
2 changes: 0 additions & 2 deletions internal/fakecgo/go_darwin_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cgo

package fakecgo

import "unsafe"
Expand Down
2 changes: 0 additions & 2 deletions internal/fakecgo/go_freebsd_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cgo

package fakecgo

import "unsafe"
Expand Down
4 changes: 1 addition & 3 deletions internal/fakecgo/go_freebsd_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cgo

package fakecgo

import "unsafe"
Expand All @@ -16,7 +14,7 @@ func _cgo_sys_thread_start(ts *ThreadStart) {
var size size_t
var err int

// fprintf(stderr, "runtime/cgo: _cgo_sys_thread_start: fn=%p, g=%p\n", ts->fn, ts->g); // debug
//fprintf(stderr, "runtime/cgo: _cgo_sys_thread_start: fn=%p, g=%p\n", ts->fn, ts->g); // debug
sigfillset(&ign)
pthread_sigmask(SIG_SETMASK, &ign, &oset)

Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/go_libinit.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

package fakecgo

Expand Down
2 changes: 0 additions & 2 deletions internal/fakecgo/go_linux_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cgo

package fakecgo

import "unsafe"
Expand Down
2 changes: 0 additions & 2 deletions internal/fakecgo/go_linux_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cgo

package fakecgo

import "unsafe"
Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/go_setenv.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

package fakecgo

Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/go_util.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

package fakecgo

Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/iscgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

// The runtime package contains an uninitialized definition
// for runtime·iscgo. Override it to tell the runtime we're here.
Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/libcgo.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

package fakecgo

Expand Down
2 changes: 0 additions & 2 deletions internal/fakecgo/libcgo_darwin.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo

package fakecgo

type (
Expand Down
2 changes: 0 additions & 2 deletions internal/fakecgo/libcgo_freebsd.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo

package fakecgo

type (
Expand Down
2 changes: 0 additions & 2 deletions internal/fakecgo/libcgo_linux.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo

package fakecgo

type (
Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/setenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

package fakecgo

Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/symbols.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions internal/fakecgo/symbols_darwin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions internal/fakecgo/symbols_freebsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions internal/fakecgo/symbols_linux.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/fakecgo/trampolines_amd64.s
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo && (darwin || linux || freebsd)
//go:build darwin || linux || freebsd

/*
trampoline for emulating required C functions for cgo in go (see cgo.go)
Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/trampolines_arm64.s
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

#include "textflag.h"
#include "go_asm.h"
Expand Down
2 changes: 1 addition & 1 deletion internal/fakecgo/trampolines_stubs.s
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2022 The Ebitengine Authors

//go:build !cgo && (darwin || freebsd || linux)
//go:build darwin || freebsd || linux

#include "textflag.h"

Expand Down

0 comments on commit 7af1ebf

Please sign in to comment.