Added Timestamp::Min/Max which help define extreme timestamps, useful to initialize variables, especially for comparison.

Added NOMINMAX as a preprocessor define for Windows. Otherwise some Windows headers define min/max as macros which interferes with std::numeric_limits::min/max

Added poco_assert_msg and poco_assert_msg_dbg, which are equivalent to poco_assert and poco_assert_dbg, respectively, but support an extra text parameter.
This commit is contained in:
Ivan Popivanov
2014-10-14 22:37:12 -04:00
parent d864a9b7ea
commit 4707a6df83
5 changed files with 26 additions and 12 deletions

View File

@@ -18,6 +18,7 @@
#include "Poco/Timespan.h"
#include "Poco/Exception.h"
#include <algorithm>
#include <limits>
#if defined(POCO_OS_FAMILY_UNIX)
#include <time.h>
#include <unistd.h>
@@ -260,6 +261,8 @@ Timestamp& Timestamp::operator -= (const Timespan& span)
return *this -= span.totalMicroseconds();
}
const Timestamp::TimeVal Timestamp::Min = std::numeric_limits<Timestamp::TimeVal>::min();
const Timestamp::TimeVal Timestamp::Max = std::numeric_limits<Timestamp::TimeVal>::max();
#if defined(_WIN32)