x86 Darwin returns structs of size 1, 2, 4, and 8 in registers (#876)
authorMatthew Flatt <mflatt@cs.utah.edu>
Fri, 31 Jan 2025 20:40:40 +0000 (13:40 -0700)
committerGitHub <noreply@github.com>
Fri, 31 Jan 2025 20:40:40 +0000 (15:40 -0500)
src/x86/ffi.c

index 8b53f73e7cd476303dc71ab54d0c11e13602d592..6862533f282a296ad7283430b4a99117df98512f 100644 (file)
@@ -118,7 +118,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
       break;
     case FFI_TYPE_STRUCT:
       {
-#ifdef X86_WIN32
+#if defined(X86_WIN32) || defined(X86_DARWIN)
         size_t size = cif->rtype->size;
         if (size == 1)
           flags = X86_RET_STRUCT_1B;