magic_enum icon indicating copy to clipboard operation
magic_enum copied to clipboard

Fix __FUNCSIG__ parsing on x86 by explicitly declaring the calling convention

Open jediry opened this issue 8 months ago • 0 comments

This change fixes parsing of enum value names on MSVC x86, by explicitly specifying the calling convention as __cdecl. Calling conventions aren't really a thing on x64, but on x86 the default calling convention can be changed w/ compiler flags. Since the parsing of the enum out of FUNCSIG relies on the precise format of this string, the calling convention needs to be __cdecl, or else the location of the ( )s is different than expected.

To fix my usage of magic_enum, I needed to add __cdecl to the instance on line 497, but I suspect that the other two functions that similarly parse these magic symbols also need this treatment to function properly on x86 under all possible default calling conventions, so I went ahead and fixed them as well.

jediry avatar Apr 07 '25 06:04 jediry