diff options
Diffstat (limited to 'qpid/cpp')
| -rwxr-xr-x | qpid/cpp/include/qpid/sys/posix/IntegerTypes.h | 3 | ||||
| -rwxr-xr-x | qpid/cpp/include/qpid/sys/windows/IntegerTypes.h | 11 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/broker/SelectorExpression.cpp | 5 |
3 files changed, 15 insertions, 4 deletions
diff --git a/qpid/cpp/include/qpid/sys/posix/IntegerTypes.h b/qpid/cpp/include/qpid/sys/posix/IntegerTypes.h index ce97f7bde8..eacdbc8446 100755 --- a/qpid/cpp/include/qpid/sys/posix/IntegerTypes.h +++ b/qpid/cpp/include/qpid/sys/posix/IntegerTypes.h @@ -21,6 +21,9 @@ * */ +// Tell stdint we do want its macros! +#define __STDC_LIMIT_MACROS +#define __STDC_CONSTANT_MACROS #include <stdint.h> #endif /*!QPID_SYS_INTEGERTYPES_H*/ diff --git a/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h b/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h index 28b82da1a0..df8a3c4731 100755 --- a/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h +++ b/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h @@ -21,15 +21,22 @@ * */ +#if _MSC_VER < 1800 +#include <stdlib.h> +#define strtoull _strtoui64 +#include <limits.h> +#endif +#if _MSC_VER < 1600 typedef unsigned char uint8_t; +typedef signed char int8_t; typedef unsigned short uint16_t; typedef short int16_t; typedef unsigned int uint32_t; typedef int int32_t; -#if defined(_MSC_VER) -typedef signed char int8_t; typedef unsigned __int64 uint64_t; typedef __int64 int64_t; +#define INT64_MAX _I64_MAX +#define INT64_MIN _I64_MIN #else #include <stdint.h> #endif diff --git a/qpid/cpp/src/qpid/broker/SelectorExpression.cpp b/qpid/cpp/src/qpid/broker/SelectorExpression.cpp index d882814443..497ec2f6f5 100644 --- a/qpid/cpp/src/qpid/broker/SelectorExpression.cpp +++ b/qpid/cpp/src/qpid/broker/SelectorExpression.cpp @@ -1003,9 +1003,10 @@ Expression* parseExactNumeric(const Token& token, bool negate) base = 8; } errno = 0; - uint64_t value = std::strtoull(s.c_str(), 0, base); + uint64_t value = strtoull(s.c_str(), 0, base); if (!errno && (base || value<=INT64_MAX)) { - return new Literal(static_cast<int64_t>(negate ? -value : value)); + int64_t r = value; + return new Literal((negate ? -r : r)); } if (negate && value==INT64_MAX+1ull) return new Literal(INT64_MIN); error = "integer literal too big"; |
