The MinGW headers do define _M_IX86 (contrary to clang-cl and MSVC where it is a compiler predefined macro), but the headers that define it aren't included here.
Also check these defines for setting the symbol prefix, instead of inconsistently using _WIN64 for that.