From 62d0f7e8e031251a4622cd0c9bc8bdc17048cfcd Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 5 Apr 2015 01:52:52 +0200 Subject: compat/chrono_literals: Add C++14 backport. Add user-defined literals for duration types (like the ones from C++14), Because these are user-defined they start with an underscore. --- src/menu/mouse_event.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/menu/mouse_event.cpp') diff --git a/src/menu/mouse_event.cpp b/src/menu/mouse_event.cpp index 3f4104a0..ddcc00f2 100644 --- a/src/menu/mouse_event.cpp +++ b/src/menu/mouse_event.cpp @@ -25,6 +25,7 @@ #include #include "mouse_event.hpp" +#include "utils/compat/chrono_literals.hpp" namespace usdx { @@ -48,17 +49,17 @@ namespace usdx { if (direction == UP) { if (this->direction == DOWN) { - if (time.since(std::chrono::milliseconds{5000})) + if (time.since(5000_ms)) return CLICK; } else if (this->direction == CLICK) { - if (time.since(std::chrono::milliseconds{5000})) + if (time.since(5000_ms)) return DBL_CLICK; } } else if (direction == DOWN) { if (this->direction == CLICK && - time.since(std::chrono::milliseconds{5000})) + time.since(5000_ms)) return CLICK; } } -- cgit v1.2.3