examples/libc: reorder OSes in alphabetical order (#307)
This change also updates README by removing NetBSD.
- commit
- d99d2bef7bd53bf6bdd93512c2b3c3ede605192e
- author
- Hajime Hoshi · · 2025-03-19 19:23 UTC
- committer
- GitHub · · 2025-03-19 19:23 UTC
- parent
- 1b61881
- signature
- GPG Unverified
B5690EEEBB952194The key is unknown
2 files · +4 -6
M README.md +2 -4
| @@ -35,8 +35,8 @@ except for float arguments and return values. | |||
| 35 | 35 | ||
| 36 | 36 | ## Example | |
| 37 | 37 | ||
| 38 | - | The example below only showcases purego use for macOS, and Linux. The other platforms require special handling which can | |
| 39 | - | be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD. | |
| 38 | + | The example below only showcases purego use for macOS and Linux. The other platforms require special handling which can | |
| 39 | + | be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports FreeBSD and Windows. | |
| 40 | 40 | ||
| 41 | 41 | ```go | |
| 42 | 42 | package main | |
| @@ -54,8 +54,6 @@ func getSystemLibrary() string { | |||
| 54 | 54 | return "/usr/lib/libSystem.B.dylib" | |
| 55 | 55 | case "linux": | |
| 56 | 56 | return "libc.so.6" | |
| 57 | - | case "netbsd": | |
| 58 | - | return "libc.so" | |
| 59 | 57 | default: | |
| 60 | 58 | panic(fmt.Errorf("GOOS=%s is not supported", runtime.GOOS)) | |
| 61 | 59 | } | |
| @@ -35,8 +35,8 @@ except for float arguments and return values. | |||||
| 35 | 35 | ||||
| 36 | ## Example | 36 | ## Example | ||
| 37 | 37 | ||||
| 38 | - | The example below only showcases purego use for macOS, and Linux. The other platforms require special handling which can | 38 | + | The example below only showcases purego use for macOS and Linux. The other platforms require special handling which can |
| 39 | - | be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD. | 39 | + | be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports FreeBSD and Windows. |
| 40 | 40 | ||||
| 41 | ```go | 41 | ```go | ||
| 42 | package main | 42 | package main | ||
| @@ -54,8 +54,6 @@ func getSystemLibrary() string { | |||||
| 54 | return "/usr/lib/libSystem.B.dylib" | 54 | return "/usr/lib/libSystem.B.dylib" | ||
| 55 | case "linux": | 55 | case "linux": | ||
| 56 | return "libc.so.6" | 56 | return "libc.so.6" | ||
| 57 | - | case "netbsd": | |||
| 58 | - | return "libc.so" | |||
| 59 | default: | 57 | default: | ||
| 60 | panic(fmt.Errorf("GOOS=%s is not supported", runtime.GOOS)) | 58 | panic(fmt.Errorf("GOOS=%s is not supported", runtime.GOOS)) | ||
| 61 | } | 59 | } | ||
M examples/libc/main.go +2 -2
| @@ -16,10 +16,10 @@ func getSystemLibrary() string { | |||
| 16 | 16 | switch runtime.GOOS { | |
| 17 | 17 | case "darwin": | |
| 18 | 18 | return "/usr/lib/libSystem.B.dylib" | |
| 19 | - | case "linux": | |
| 20 | - | return "libc.so.6" | |
| 21 | 19 | case "freebsd": | |
| 22 | 20 | return "libc.so.7" | |
| 21 | + | case "linux": | |
| 22 | + | return "libc.so.6" | |
| 23 | 23 | case "netbsd": | |
| 24 | 24 | return "libc.so" | |
| 25 | 25 | case "windows": | |
| @@ -16,10 +16,10 @@ func getSystemLibrary() string { | |||||
| 16 | switch runtime.GOOS { | 16 | switch runtime.GOOS { | ||
| 17 | case "darwin": | 17 | case "darwin": | ||
| 18 | return "/usr/lib/libSystem.B.dylib" | 18 | return "/usr/lib/libSystem.B.dylib" | ||
| 19 | - | case "linux": | |||
| 20 | - | return "libc.so.6" | |||
| 21 | case "freebsd": | 19 | case "freebsd": | ||
| 22 | return "libc.so.7" | 20 | return "libc.so.7" | ||
| 21 | + | case "linux": | |||
| 22 | + | return "libc.so.6" | |||
| 23 | case "netbsd": | 23 | case "netbsd": | ||
| 24 | return "libc.so" | 24 | return "libc.so" | ||
| 25 | case "windows": | 25 | case "windows": | ||