| 1 | // SPDX-License-Identifier: Apache-2.0 |
| 2 | // SPDX-FileCopyrightText: 2022 The Ebitengine Authors |
| 3 | |
| 4 | //go:build !cgo && (darwin || freebsd || linux || netbsd) |
| 5 | |
| 6 | package fakecgo |
| 7 | |
| 8 | type ( |
| 9 | size_t uintptr |
| 10 | // Sources: |
| 11 | // Darwin (32 bytes) - https://github.com/apple/darwin-xnu/blob/2ff845c2e033bd0ff64b5b6aa6063a1f8f65aa32/bsd/sys/_types.h#L74 |
| 12 | // FreeBSD (32 bytes) - https://github.com/DoctorWkt/xv6-freebsd/blob/d2a294c2a984baed27676068b15ed9a29b06ab6f/include/signal.h#L98C9-L98C21 |
| 13 | // Linux (128 bytes) - https://github.com/torvalds/linux/blob/ab75170520d4964f3acf8bb1f91d34cbc650688e/arch/x86/include/asm/signal.h#L25 |
| 14 | sigset_t [128]byte |
| 15 | pthread_attr_t [64]byte |
| 16 | pthread_t int |
| 17 | pthread_key_t uint64 |
| 18 | ) |
| 19 | |
| 20 | // for pthread_sigmask: |
| 21 | |
| 22 | type sighow int32 |
| 23 | |
| 24 | const ( |
| 25 | SIG_BLOCK sighow = 0 |
| 26 | SIG_UNBLOCK sighow = 1 |
| 27 | SIG_SETMASK sighow = 2 |
| 28 | ) |
| 29 | |
| 30 | type G struct { |
| 31 | stacklo uintptr |
| 32 | stackhi uintptr |
| 33 | } |
| 34 | |
| 35 | type ThreadStart struct { |
| 36 | g *G |
| 37 | tls *uintptr |
| 38 | fn uintptr |
| 39 | } |