Go 1.23 added structs.HostLayout, a zero-sized marker field that tells
the compiler a struct must be laid out the way the host's C ABI expects
rather than by Go's own rules. Until now purego relied on Go's current
layout happening to match C.
Declare the marker on every struct that stands in for a C one: objc_super,
MethodDescription, PropertyAttribute, blockDescriptor and blockLayout in
package objc; G, ThreadStart, the Darwin pthread types, the NetBSD stack_t
and argset in internal/fakecgo; syscallArgs, which internal/cgo hands to C
as a struct syscallArgs; the window example's NSPoint/NSSize/NSRect and
WNDCLASSEX/RECT/POINT/MSG; and the C-representative structs in the tests.
Structs that never cross into C, such as MethodDef, FieldDef and the
callback argument block filled in by Go assembly, are left alone.
The marker field is zero-sized, so it takes no part in the C ABI. Teach
the argument classification to skip zero-sized fields, otherwise a struct
that declares it is misclassified: isAllSameFloat would panic descending
into the marker, isHFA/isHVA would stop recognizing homogeneous
aggregates, and objc's @encode would emit the marker as a member.
Closes #259
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>