fakecgo

package
v0.2.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2022 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for darwin/amd64

Overview

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.

Goals

fakecgo attempts to replicate the same naming structure as in the runtime. For example, functions that have the prefix "gcc_*" are named "go_*". This makes it easier to port other GOOSs and GOARCHs as well as to keep it in sync with runtime/cgo.

Support

Currently, fakecgo only supports macOS on amd64 & arm64. It also cannot be used with -buildmode=c-archive because that requires special initialization that fakecgo does not implement at the moment.

Usage

Using fakecgo is easy just import _ "github.com/ebitengine/purego" and then set the environment variable CGO_ENABLED=0. The recommended usage for fakecgo is to prefer using runtime/cgo if possible but if cross-compiling or fast build times are important fakecgo is available. Purego will pick which ever Cgo runtime is available and prefer the one that comes with Go (runtime/cgo).

Index

Constants

View Source
const (
	SIG_BLOCK   sighow = 0
	SIG_UNBLOCK sighow = 1
	SIG_SETMASK sighow = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type G

type G struct {
	// contains filtered or unexported fields
}

type ThreadStart

type ThreadStart struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL