From d6602a2aab1dc00663bd64759f12935283b58076 Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Mon, 13 Jun 2016 15:42:26 +0200 Subject: Fixed issue84 --- src/uscxml/Common.h | 4 ++++ src/uscxml/Interpreter.h | 2 +- src/uscxml/interpreter/BasicEventQueue.cpp | 6 +++--- src/uscxml/interpreter/BasicEventQueue.h | 1 - 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/uscxml/Common.h b/src/uscxml/Common.h index c1029f1..d1f42c7 100644 --- a/src/uscxml/Common.h +++ b/src/uscxml/Common.h @@ -20,7 +20,9 @@ #ifndef COMMON_H_YZ3CIYP #define COMMON_H_YZ3CIYP +#ifndef _MSC_VER #define ELPP_STACKTRACE_ON_CRASH 1 +#endif #if __cplusplus >= 201402L #define DEPRECATED [[deprecated]] @@ -44,6 +46,8 @@ #endif #ifdef _WIN32 +#define NOMINMAX + typedef unsigned __int32 uint32_t; // see http://stackoverflow.com/questions/1372480/c-redefinition-header-files diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h index bab0ebc..365289f 100644 --- a/src/uscxml/Interpreter.h +++ b/src/uscxml/Interpreter.h @@ -166,7 +166,7 @@ public: * @param blockMs The maximum duration in milli-seconds to wait for an event to become available. * @return The new state of the interpreter object. */ - InterpreterState step(size_t blockMs = std::numeric_limits::max()); + InterpreterState step(size_t blockMs = (std::numeric_limits::max)()); /** * Unblock and mark for finalize. diff --git a/src/uscxml/interpreter/BasicEventQueue.cpp b/src/uscxml/interpreter/BasicEventQueue.cpp index 7309392..d484ada 100644 --- a/src/uscxml/interpreter/BasicEventQueue.cpp +++ b/src/uscxml/interpreter/BasicEventQueue.cpp @@ -39,9 +39,9 @@ Event BasicEventQueue::dequeue(size_t blockMs) { // block for given milliseconds or until queue is filled std::chrono::time_point updated, now; std::chrono::milliseconds remain; - - if (blockMs > std::chrono::system_clock::duration::max().count()) { - blockMs = std::chrono::system_clock::duration::max().count(); + + if (blockMs > (std::chrono::system_clock::duration::max)().count()) { + blockMs = (std::chrono::system_clock::duration::max)().count(); } updated = now = std::chrono::system_clock::now(); diff --git a/src/uscxml/interpreter/BasicEventQueue.h b/src/uscxml/interpreter/BasicEventQueue.h index 15a1c3c..a6374d8 100644 --- a/src/uscxml/interpreter/BasicEventQueue.h +++ b/src/uscxml/interpreter/BasicEventQueue.h @@ -20,7 +20,6 @@ #ifndef BASICEVENTQUEUE_H_39DCC18B #define BASICEVENTQUEUE_H_39DCC18B - #include "EventQueueImpl.h" #include #include -- cgit v0.12