Skip to content

Commit

Permalink
Fix STL Algorithm Header Errors When Included with Platform.h
Browse files Browse the repository at this point in the history
"clamp" macro of Platform.h conflicts with "std::clamp" of the STL algorithm header. So `#include <algorithm>` forces Platform.h included after itself. This commit fixes the issue
  • Loading branch information
edgarbarney committed May 5, 2022
1 parent 2c41a96 commit fa1614d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,8 @@ using qboolean = int;
#define V_min(a, b) (((a) < (b)) ? (a) : (b))
#define V_max(a, b) (((a) > (b)) ? (a) : (b))

#ifndef _ALGORITHM_
#define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
#endif // _ALGORITHM_


0 comments on commit fa1614d

Please sign in to comment.