Xilmi / OpenXcom

Open-source clone of the original X-Com
http://openxcom.org
GNU General Public License v3.0
19 stars 10 forks source link

Msys2 clang64 build error #11

Closed Ajaja closed 5 months ago

Ajaja commented 1 year ago

https://github.com/Xilmi/OpenXcom/blob/4f088f1dfbe68374a67a205f6b2d7cb6e4bf9072/src/Engine/CrossPlatform.h#L141


E:/msys64/home/sandbox/OpenXcom-Xilmi/src/Basescape/../Mod/../Engine/CrossPlatform.h:141:6: error: use of undeclared identifier '__assume'
  141 |             __assume(false);
      |             ^
1 error generated.```
Ajaja commented 1 year ago

After changing

    #ifdef _WIN32 // MSVC
        __assume(false);
    #else  // GCC, Clang
        __builtin_unreachable();
    #endif

to

    #if defined _WIN32 && ! defined (__MINGW64__) && ! defined (__MINGW32__) // MSVC
        __assume(false);
    #else  // GCC, Clang
        __builtin_unreachable();
    #endif

compiles fine.

Xilmi commented 1 year ago

I pushed your recommended change to the repo.