aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/Compat.h
diff options
context:
space:
mode:
authormitchell <unknown>2020-01-06 20:20:56 -0500
committermitchell <unknown>2020-01-06 20:20:56 -0500
commitf6e6731598a02121be850a17a12384090b40f1ac (patch)
tree5df339d665458d5e6878c292b8e79055951fef4d /include/Compat.h
parenta7b57f9b5bb481c9b5b98dda13c0e9c44d26a237 (diff)
downloadscintilla-mirror-f6e6731598a02121be850a17a12384090b40f1ac.tar.gz
More synchronizing LongTerm3 with default.
Ideally this covers anything missed during the backport process.
Diffstat (limited to 'include/Compat.h')
-rw-r--r--include/Compat.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/Compat.h b/include/Compat.h
index d69a9a2c1..b4a9437c2 100644
--- a/include/Compat.h
+++ b/include/Compat.h
@@ -14,6 +14,12 @@
namespace Sci {
+// std::clamp
+template <typename T>
+inline constexpr T clamp(T val, T minVal, T maxVal) {
+ return (val > maxVal) ? maxVal : ((val < minVal) ? minVal : val);
+}
+
// std::round (not present on older MacOSX SDKs)
template<class T>
T round(T arg) {