pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.58k stars 364 forks source link

Include <algorithm> for std::max #5828

Closed AMDmi3 closed 1 month ago

AMDmi3 commented 1 month ago
impaktor commented 1 month ago

This silences a warning, or fixes the build on some OS?

AMDmi3 commented 1 month ago

This fixes build on FreeBSD (clang + libc++)

In file included from /work/usr/ports/games/pioneer/work/pioneer-20240314/src/BaseSphere.cpp:4:
In file included from /work/usr/ports/games/pioneer/work/pioneer-20240314/src/BaseSphere.h:7:
In file included from /work/usr/ports/games/pioneer/work/pioneer-20240314/src/Camera.h:10:
In file included from /work/usr/ports/games/pioneer/work/pioneer-20240314/src/graphics/Frustum.h:7:
In file included from /work/usr/ports/games/pioneer/work/pioneer-20240314/src/Plane.h:9:
/work/usr/ports/games/pioneer/work/pioneer-20240314/src/vector3.h:314:13: error: no member named 'max' in namespace 'std'; did you mean 'fmax'?
        using std::max; // support max(T) overloads
              ~~~~~^~~
                   fmax
/usr/include/c++/v1/cmath:434:9: note: 'fmax' declared here
using ::fmax _LIBCPP_USING_IF_EXISTS;
        ^