struct_386.go raw
1 // SPDX-License-Identifier: Apache-2.0
2 // SPDX-FileCopyrightText: 2025 The Ebitengine Authors
3
4 package purego
5
6 import "reflect"
7
8 func addStruct(v reflect.Value, numInts, numFloats, numStack *int, addInt, addFloat, addStack func(uintptr), keepAlive []any) []any {
9 panic("purego: struct arguments are not supported")
10 }
11
12 func getStruct(outType reflect.Type, syscall syscall15Args) (v reflect.Value) {
13 panic("purego: struct returns are not supported")
14 }
15
16 func placeRegisters(v reflect.Value, addFloat func(uintptr), addInt func(uintptr)) {
17 panic("purego: placeRegisters not implemented on 386")
18 }
19
20 // shouldBundleStackArgs always returns false on 386
21 // since C-style stack argument bundling is only needed on Darwin ARM64.
22 func shouldBundleStackArgs(v reflect.Value, numInts, numFloats int) bool {
23 return false
24 }
25
26 // structFitsInRegisters is not used on 386.
27 func structFitsInRegisters(val reflect.Value, tempNumInts, tempNumFloats int) (bool, int, int) {
28 panic("purego: structFitsInRegisters should not be called on 386")
29 }
30
31 // collectStackArgs is not used on 386.
32 func collectStackArgs(args []reflect.Value, startIdx int, numInts, numFloats int,
33 keepAlive []any, addInt, addFloat, addStack func(uintptr),
34 pNumInts, pNumFloats, pNumStack *int) ([]reflect.Value, []any) {
35 panic("purego: collectStackArgs should not be called on 386")
36 }
37
38 // bundleStackArgs is not used on 386.
39 func bundleStackArgs(stackArgs []reflect.Value, addStack func(uintptr)) {
40 panic("purego: bundleStackArgs should not be called on 386")
41 }
42