libcgo.go 944 B

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