Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Ensure that std::abs is used and not integer abs #293

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

paradust7
Copy link
Contributor

@paradust7 paradust7 commented Feb 21, 2024

I have C++20 enabled in xr build for MSVC, and abs triggers an error here because it is trying to choose between non-std integer versions of abs:

irrMath.h(200,10): error C2668: 'abs': ambiguous call to overloaded function 

  C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stdlib.h(368,22):
  could be '__int64 abs(const __int64) noexcept'
  C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\stdlib.h(363,17):
  or       'long abs(const long) noexcept'
  C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt\corecrt_math.h(470,38):
  or       'int abs(int)'

This fixes this error by ensuring std::abs is always used.

@sfan5 sfan5 merged commit 270b2be into minetest:master Feb 21, 2024
19 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants