fix build & test conformance issues on mingw32/gcc and mingw64/clang (#1034)

CLI/Reduce.cpp:
Never worked under MinGW as-is. Add check for MinGW as they're defined.

VM/src/lmem.cpp:
MinGW layout follows more closely MSVC. Checks before were only correct
for 32-bit gcc / clang in non-Windows.

NOTES:
__MINGW32__ is defined on both 32-bit and 64-bit, __MINGW64__ is 64-bit
only. 32-bit MinGW compilers (both Clang & GCC) have a floating point
test error on math.noise, specifically math.lua:258. All other test
cases / unit tests pass modulo stack size issues (so requires optimized build).

---------

Co-authored-by: jdp_ <42700985+jdpatdiscord@users.noreply.github.com>
This commit is contained in:
Arseny Kapoulkine 2023-09-05 10:22:35 -07:00 committed by GitHub
parent f0a2e79365
commit 105f54b233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -15,7 +15,7 @@
#define VERBOSE 0 // 1 - print out commandline invocations. 2 - print out stdout
#ifdef _WIN32
#if defined(_WIN32) && !defined(__MINGW32__)
const auto popen = &_popen;
const auto pclose = &_pclose;

View File

@ -98,6 +98,8 @@
*/
#if defined(__APPLE__)
#define ABISWITCH(x64, ms32, gcc32) (sizeof(void*) == 8 ? x64 : gcc32)
#elif defined(__i386__) && defined(__MINGW32__) && !defined(__MINGW64__)
#define ABISWITCH(x64, ms32, gcc32) (ms32)
#elif defined(__i386__) && !defined(_MSC_VER)
#define ABISWITCH(x64, ms32, gcc32) (gcc32)
#else