Skip to content

Commit

Permalink
Document supported platforms and status of project (#168)
Browse files Browse the repository at this point in the history
Closes #149
  • Loading branch information
TotallyGamerJet authored Sep 23, 2023
1 parent 6aa09b6 commit 1600172
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

A library for calling C functions from Go without Cgo.

> This is beta software so expect bugs and potentially API breaking changes
> but each release will be tagged to avoid breaking people's code.
> Bug reports are encouraged.
## Motivation

The [Ebitengine](https://github.com/hajimehoshi/ebiten) game engine was ported to use only Go on Windows. This enabled
Expand All @@ -17,6 +21,15 @@ born to bring that same vision to the other platforms supported by Ebitengine.
- **Dynamic Linking**: Load symbols at runtime and use it as a plugin system.
- **Foreign Function Interface**: Call into other languages that are compiled into shared objects.

## Supported Platforms

- **FreeBSD**: amd64, arm64
- **Linux**: amd64, arm64
- **macOS / iOS**: amd64, arm64
- **Windows**: 386*, amd64, arm*, arm64

`*` These architectures only support SyscallN and NewCallback

## Example

This example only works on macOS and Linux. For a complete example look at [libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD.
Expand Down Expand Up @@ -55,6 +68,11 @@ func main() {

Then to run: `CGO_ENABLED=0 go run main.go`

## Questions

If you have questions about how to incorporate purego in your project or want to discuss
how it works join the [Discord](https://discord.com/channels/842049801528016967/1123106378731487345)!

### External Code

Purego uses code that originates from the Go runtime. These files are under the BSD-3
Expand All @@ -71,4 +89,5 @@ This is a list of the copied files:
* `internal/fakecgo/setenv.go` from package `runtime/cgo`
* `internal/fakecgo/freebsd.go` from package `runtime/cgo`

The files `abi_*.h` and `internal/fakecgo/abi_*.h` are the same because Bazel does not support cross-package use of `#include` so we need each one once per package. (cf. [issue](https://github.com/bazelbuild/rules_go/issues/3636))
The files `abi_*.h` and `internal/fakecgo/abi_*.h` are the same because Bazel does not support cross-package use of
`#include` so we need each one once per package. (cf. [issue](https://github.com/bazelbuild/rules_go/issues/3636))

0 comments on commit 1600172

Please sign in to comment.