1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: 2026 The Ebitengine Authors
3
4//go:build !(amd64 || arm || arm64 || loong64 || ppc64le || riscv64 || s390x)
5
6package purego
7
8import (
9 "reflect"
10 "unsafe"
11)
12
13// This file provides the struct-handling helpers for architectures that do
14// not support struct arguments or returns: 386, and any architecture reachable
15// only through the integer-only cgo fallback. Every struct operation panics.
16
17func addStruct(v reflect.Value, numInts, numFloats, numStack *int, addInt, addFloat, addStack func(uintptr), keepAlive []any) []any {
18 panic("purego: struct arguments are not supported on this architecture")
19}
20
21func getStruct(outType reflect.Type, syscall syscallArgs) reflect.Value {
22 panic("purego: struct returns are not supported on this architecture")
23}
24
25// shouldBundleStackArgs always returns false because C-style stack argument
26// bundling is only needed on Darwin ARM64.
27func shouldBundleStackArgs(v reflect.Value, numInts, numFloats int) bool {
28 return false
29}
30
31func collectStackArgs(args []reflect.Value, startIdx int, numInts, numFloats int,
32 keepAlive []any, addInt, addFloat, addStack func(uintptr),
33 pNumInts, pNumFloats, pNumStack *int) ([]reflect.Value, []any) {
34 panic("purego: collectStackArgs should not be called on this architecture")
35}
36
37func bundleStackArgs(stackArgs []reflect.Value, addStack func(uintptr)) {
38 panic("purego: bundleStackArgs should not be called on this architecture")
39}
40
41func getCallbackStruct(inType reflect.Type, frame unsafe.Pointer, floatsN *int, intsN *int, stackSlot *int, stackByteOffset *uintptr) reflect.Value {
42 panic("purego: struct callback arguments are not supported on this architecture")
43}
44
45func setStruct(a *callbackArgs, ret reflect.Value) {
46 panic("purego: struct returns are not supported on this architecture")
47}