diff options
author | Andrew Stitcher <astitcher@apache.org> | 2015-09-03 20:45:52 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2015-09-03 20:45:52 +0000 |
commit | 215baaf0af925fc020cc89a77092252f6061854d (patch) | |
tree | 8ebd572b93f0dc183d434f14c0ce58f0508f36f6 | |
parent | 14de0a97b80cc0f63208b61654dd0348fd3da8b1 (diff) | |
download | qpid-python-215baaf0af925fc020cc89a77092252f6061854d.tar.gz |
QPID-6718: Small fixes to compile on slightly older versions of G++ and Visual Studio
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1701130 13f79535-47bb-0310-9956-ffa450edef68
-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"; |