1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

use builtin min and max

This commit is contained in:
Linus Unnebäck
2015-12-15 09:09:15 +01:00
parent aed5117384
commit 4319e57024
2 changed files with 6 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <algorithm>
/**
* Common mathematical functions.
*/
@@ -7,17 +9,17 @@ namespace Math {
template<typename T>
T Min(T a, T b) {
return a < b ? a : b;
return (std::min)(a, b);
}
template<typename T>
T Max(T a, T b) {
return a > b ? a : b;
return (std::max)(a, b);
}
template<typename T>
T Clamp(T low, T x, T high) {
return Min(Max(low, x), high);
return (std::min)((std::max)(low, x), high);
}
}

View File

@@ -6,6 +6,7 @@ extern "C" {
}
#include "../core/FileStream.hpp"
#include "../core/Math.hpp"
#include "../core/Memory.hpp"
#include "../core/StringBuilder.hpp"
#include "LanguagePack.h"