Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests under GCC and MinGW #6

Closed
wants to merge 8 commits into from

Conversation

Mixaill
Copy link

@Mixaill Mixaill commented Mar 1, 2020

  • cmake: refactor and add GCC support
  • cpuid: removed unneeded includes, fix cpuid call for GCC
  • ext: removed windows.h include
  • math3: fix include filenames casing
  • math3: added lacking defines for non-Windows platforms
  • math3: replace rand() with XM_RAND() which max values is limited with 0x8000 (glibc version generates values up to INT32_MAX, which causes test failures with GCC)
  • math3, shmath: replace functions like _fpclass with std:: alternatives
  • xdsp: replace _aligned_malloc with XM_ALIGNED_MALLOC, which selects _aligned_malloc on MSVC and std::aligned_alloc on other toolsets

Requires microsoft/DirectXMath#86


Tested with

  • Ubuntu 20.04
    • GCC 9
    • Clang 9
  • Windows
    • MSVS 16.4.5
    • Clang-CL 9.0.0

@Mixaill Mixaill changed the title Fix tests under GCC Fix tests under GCC and MinGW Mar 1, 2020
@walbourn
Copy link
Owner

Took a fair bit of this in this commit to validate the MinGW support. If you want to merge or rebase, we can see what's left.

@walbourn walbourn self-assigned this Mar 11, 2020
@Mixaill Mixaill force-pushed the gcc-fixes-v2 branch 2 times, most recently from 336f8d0 to 0c3e083 Compare March 11, 2020 20:55
@Mixaill
Copy link
Author

Mixaill commented Mar 11, 2020

@walbourn rebased, tested on Ubuntu/GCC 9 and Ubuntu/Clang 9

math3/xmvec.cpp Outdated Show resolved Hide resolved
math3/math3.h Outdated Show resolved Hide resolved
@Mixaill Mixaill force-pushed the gcc-fixes-v2 branch 2 times, most recently from e0b51d3 to b8add1f Compare March 16, 2020 20:30
@Mixaill
Copy link
Author

Mixaill commented Mar 16, 2020

@walbourn switched to wchar_t and retested in MSVC, MinGW, GCC and Clang.

@Mixaill Mixaill requested a review from walbourn March 17, 2020 11:29
it is already applied in the if(MSVC) section
it is required for _xgetbv()
_countof() is the MSVC extension
_aligned_malloc is supported only in the MSVCRT
but MSVCRT does not support std::alligned_alloc()
- add defines for secure functions
- rearrange includes to fix compilation error
- add WINAPI-specific defines for non-Windows OS
- add defines for calling conventions
- do not include <tchar.h> and <intrin.h> on non-Windows OS
@Mixaill
Copy link
Author

Mixaill commented Jul 19, 2020

@walbourn rebased

@walbourn
Copy link
Owner

Finished up the changes you proposed in a slightly different form as well as adding ARM64 linux support in #11.

Thanks!

@walbourn walbourn closed this Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants