Unified · Split
| @@ -8093,6 +8093,11 @@ static void init_putv(init_params *p, CType *type, unsigned long c) · 8092 unmodified lines | ||
| 8093 | 8093 | else if (sizeof(double) == LDOUBLE_SIZE) |
| 8094 | 8094 | memcpy(ptr, &vtop->c.ld, LDOUBLE_SIZE); |
| 8095 | 8095 | #ifndef TCC_CROSS_TEST |
| 8096 | +#if defined(TCC_TARGET_MACHO) && defined(TCC_TARGET_X86_64) | |
| 8097 | + /* Special case for Rosetta to handle --cpu=x86_64 on macOS */ | |
| 8098 | + else if (sizeof(double) == sizeof(long double)) | |
| 8099 | + memcpy(ptr, &vtop->c.ld, sizeof(double)); | |
| 8100 | +#endif | |
| 8096 | 8101 | else |
| 8097 | 8102 | tcc_error("can't cross compile long double constants"); |
| 8098 | 8103 | #endif |