It must go into {$IFNDEF CPUARM} for AArch64 too? on FPC aarch64, CPUARM is not defined, so it goes into. I hope it's OK.
{$IFNDEF CPUARM}
{$IFDEF CPUX64}
{$DEFINE 64_BIT_CALLBACK}
{$ELSE}
{$IFDEF MACOS}
{$DEFINE ALIGNED_32_BIT_CALLBACK}
{$ELSE}
{$DEFINE SIMPLE_32_BIT_CALLBACK}
{$ENDIF MACOS}
{$ENDIF CPUX64}
{$ENDIF CPUARM}