diff --git a/include/jsoncons/config/binary_config.hpp b/include/jsoncons/config/binary_config.hpp deleted file mode 100644 index 656a1b030..000000000 --- a/include/jsoncons/config/binary_config.hpp +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright 2017 Daniel Parker -// Distributed under the Boost license, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See https://github.com/danielaparker/jsoncons for latest version - -#ifndef JSONCONS_CONFIG_BINARY_CONFIG_HPP -#define JSONCONS_CONFIG_BINARY_CONFIG_HPP - -#include -#include -#include -#include -#include // std::memcpy -#include -#include // std::enable_if - -// The definitions below follow the definitions in compiler_support_p.h, https://github.com/01org/tinycbor -// MIT license - -#ifdef __F16C__ -# include -#endif - -#ifndef __has_builtin -# define __has_builtin(x) 0 -#endif - -#if defined(__GNUC__) -#if (__GNUC__ * 100 + __GNUC_MINOR__ >= 403) || (__has_builtin(__builtin_bswap64) && __has_builtin(__builtin_bswap32)) -# define JSONCONS_BYTE_SWAP_64 __builtin_bswap64 -# define JSONCONS_BYTE_SWAP_32 __builtin_bswap32 -# ifdef __INTEL_COMPILER -# define JSONCONS_BYTE_SWAP_16 _bswap16 -# elif (__GNUC__ * 100 + __GNUC_MINOR__ >= 608) || __has_builtin(__builtin_bswap16) -# define JSONCONS_BYTE_SWAP_16 __builtin_bswap16 -# endif -#endif -#elif defined(__sun) -# include -#elif defined(_MSC_VER) -// MSVC, which implies sizeof(long) == 4 -# define JSONCONS_BYTE_SWAP_64 _byteswap_uint64 -# define JSONCONS_BYTE_SWAP_32 _byteswap_ulong -# define JSONCONS_BYTE_SWAP_16 _byteswap_ushort -#endif - -namespace jsoncons { -namespace binary { - - struct uint128_holder - { - uint64_t lo; - uint64_t hi; - }; - - static inline bool add_check_overflow(std::size_t v1, std::size_t v2, std::size_t *r) - { - #if ((defined(__GNUC__) && (__GNUC__ >= 5)) && !defined(__INTEL_COMPILER)) || __has_builtin(__builtin_add_overflow) - return __builtin_add_overflow(v1, v2, r); - #else - // unsigned additions are well-defined - *r = v1 + v2; - return v1 > v1 + v2; - #endif - } - - #if defined(__apple_build_version__) && ((__clang_major__ < 8) || ((__clang_major__ == 8) && (__clang_minor__ < 1))) - #define APPLE_MISSING_INTRINSICS 1 - #endif - - inline - uint16_t encode_half(double val) - { - #if defined(__F16C__) && !defined(APPLE_MISSING_INTRINSICS) - return _cvtss_sh((float)val, 3); - #else - uint64_t v; - std::memcpy(&v, &val, sizeof(v)); - int64_t sign = static_cast(v >> 63 << 15); - int64_t exp = (v >> 52) & 0x7ff; - int64_t mant = v << 12 >> 12 >> (53-11); /* keep only the 11 most significant bits of the mantissa */ - exp -= 1023; - if (exp == 1024) { - /* infinity or NaN */ - exp = 16; - mant >>= 1; - } else if (exp >= 16) { - /* overflow, as largest number */ - exp = 15; - mant = 1023; - } else if (exp >= -14) { - /* regular normal */ - } else if (exp >= -24) { - /* subnormal */ - mant |= 1024; - mant >>= -(exp + 14); - exp = -15; - } else { - /* underflow, make zero */ - return 0; - } - - /* safe cast here as bit operations above guarantee not to overflow */ - return static_cast(sign | ((exp + 15) << 10) | mant); - #endif - } - - /* this function was copied & adapted from RFC 7049 Appendix D */ - inline - double decode_half(uint16_t half) - { - #if defined(__F16C__) && !defined(APPLE_MISSING_INTRINSICS) - return _cvtsh_ss(half); - #else - int64_t exp = (half >> 10) & 0x1f; - int64_t mant = half & 0x3ff; - double val; - if (exp == 0) - { - val = ldexp(static_cast(mant), -24); - } - else if (exp != 31) - { - val = ldexp(static_cast(mant) + 1024.0, static_cast(exp - 25)); - } - else - { - val = mant == 0 ? std::numeric_limits::infinity() : std::nan(""); - } - return half & 0x8000 ? -val : val; - #endif - } - - // byte_swap - - template - typename std::enable_if::value && sizeof(T) == sizeof(uint8_t),T>::type - byte_swap(T val) - { - return val; - } - - template - typename std::enable_if::value && sizeof(T) == sizeof(uint16_t),T>::type - byte_swap(T val) - { - #if defined(JSONCONS_BYTE_SWAP_16) - return JSONCONS_BYTE_SWAP_16(val); - #else - return (static_cast(val) >> 8) | (static_cast(val) << 8); - #endif - } - - template - typename std::enable_if::value && sizeof(T) == sizeof(uint32_t),T>::type - byte_swap(T val) - { - #if defined(JSONCONS_BYTE_SWAP_32) - return JSONCONS_BYTE_SWAP_32(val); - #else - uint32_t tmp = ((static_cast(val) << 8) & 0xff00ff00) | ((static_cast(val) >> 8) & 0xff00ff); - return (tmp << 16) | (tmp >> 16); - #endif - } - - template - typename std::enable_if::value && sizeof(T) == sizeof(uint64_t),T>::type - byte_swap(T val) - { - #if defined(JSONCONS_BYTE_SWAP_64) - return JSONCONS_BYTE_SWAP_64(val); - #else - uint64_t tmp = ((static_cast(val) & 0x00000000ffffffffull) << 32) | ((static_cast(val) & 0xffffffff00000000ull) >> 32); - tmp = ((tmp & 0x0000ffff0000ffffull) << 16) | ((tmp & 0xffff0000ffff0000ull) >> 16); - return ((tmp & 0x00ff00ff00ff00ffull) << 8) | ((tmp & 0xff00ff00ff00ff00ull) >> 8); - #endif - } - - template - typename std::enable_if::value && sizeof(T) == sizeof(uint32_t),T>::type - byte_swap(T val) - { - uint32_t x; - std::memcpy(&x,&val,sizeof(uint32_t)); - uint32_t y = byte_swap(x); - T val2; - std::memcpy(&val2,&y,sizeof(uint32_t)); - return val2; - } - - template - typename std::enable_if::value && sizeof(T) == sizeof(uint64_t),T>::type - byte_swap(T val) - { - uint64_t x; - std::memcpy(&x,&val,sizeof(uint64_t)); - uint64_t y = byte_swap(x); - T val2; - std::memcpy(&val2,&y,sizeof(uint64_t)); - return val2; - } - - template - typename std::enable_if::value && sizeof(T) == 2*sizeof(uint64_t),T>::type - byte_swap(T val) - { - uint128_holder x; - uint8_t buf[2*sizeof(uint64_t)]; - std::memcpy(buf,&val,2*sizeof(uint64_t)); - std::memcpy(&x.lo,buf,sizeof(uint64_t)); - std::memcpy(&x.hi,buf+sizeof(uint64_t),sizeof(uint64_t)); - - uint128_holder y; - y.lo = byte_swap(x.hi); - y.hi = byte_swap(x.lo); - - T val2; - std::memcpy(&val2,&y,2*sizeof(uint64_t)); - - return val2; - } - -} // namespace binary -} // namespace jsoncons - -#endif // JSONCONS_CONFIG_BINARY_CONFIG_HPP diff --git a/include/jsoncons/config/compiler_support.hpp b/include/jsoncons/config/compiler_support.hpp index f4a463724..ecddf12aa 100644 --- a/include/jsoncons/config/compiler_support.hpp +++ b/include/jsoncons/config/compiler_support.hpp @@ -374,47 +374,118 @@ namespace jsoncons { #endif #endif -namespace jsoncons { +// The definitions below follow the definitions in compiler_support_p.h, https://github.com/01org/tinycbor +// MIT license + +#ifdef __F16C__ +# include +#endif + +#ifndef __has_builtin +# define __has_builtin(x) 0 +#endif + +#if defined(__GNUC__) +#if (__GNUC__ * 100 + __GNUC_MINOR__ >= 403) || (__has_builtin(__builtin_bswap64) && __has_builtin(__builtin_bswap32)) +# define JSONCONS_BYTE_SWAP_64 __builtin_bswap64 +# define JSONCONS_BYTE_SWAP_32 __builtin_bswap32 +# ifdef __INTEL_COMPILER +# define JSONCONS_BYTE_SWAP_16 _bswap16 +# elif (__GNUC__ * 100 + __GNUC_MINOR__ >= 608) || __has_builtin(__builtin_bswap16) +# define JSONCONS_BYTE_SWAP_16 __builtin_bswap16 +# endif +#endif +#elif defined(__sun) +# include +#elif defined(_MSC_VER) +// MSVC, which implies sizeof(long) == 4 +# define JSONCONS_BYTE_SWAP_64 _byteswap_uint64 +# define JSONCONS_BYTE_SWAP_32 _byteswap_ulong +# define JSONCONS_BYTE_SWAP_16 _byteswap_ushort +#endif + +namespace jsoncons { +namespace binary { - class assertion_error : public std::runtime_error + static inline bool add_check_overflow(std::size_t v1, std::size_t v2, std::size_t *r) { - public: - assertion_error(const std::string& s) noexcept - : std::runtime_error(s) + #if ((defined(__GNUC__) && (__GNUC__ >= 5)) && !defined(__INTEL_COMPILER)) || __has_builtin(__builtin_add_overflow) + return __builtin_add_overflow(v1, v2, r); + #else + // unsigned additions are well-defined + *r = v1 + v2; + return v1 > v1 + v2; + #endif + } + + #if defined(__apple_build_version__) && ((__clang_major__ < 8) || ((__clang_major__ == 8) && (__clang_minor__ < 1))) + #define APPLE_MISSING_INTRINSICS 1 + #endif + + inline + uint16_t encode_half(double val) + { + #if defined(__F16C__) && !defined(APPLE_MISSING_INTRINSICS) + return _cvtss_sh((float)val, 3); + #else + uint64_t v; + std::memcpy(&v, &val, sizeof(v)); + int64_t sign = static_cast(v >> 63 << 15); + int64_t exp = (v >> 52) & 0x7ff; + int64_t mant = v << 12 >> 12 >> (53-11); /* keep only the 11 most significant bits of the mantissa */ + exp -= 1023; + if (exp == 1024) { + /* infinity or NaN */ + exp = 16; + mant >>= 1; + } else if (exp >= 16) { + /* overflow, as largest number */ + exp = 15; + mant = 1023; + } else if (exp >= -14) { + /* regular normal */ + } else if (exp >= -24) { + /* subnormal */ + mant |= 1024; + mant >>= -(exp + 14); + exp = -15; + } else { + /* underflow, make zero */ + return 0; + } + + /* safe cast here as bit operations above guarantee not to overflow */ + return static_cast(sign | ((exp + 15) << 10) | mant); + #endif + } + + /* this function was copied & adapted from RFC 7049 Appendix D */ + inline + double decode_half(uint16_t half) + { + #if defined(__F16C__) && !defined(APPLE_MISSING_INTRINSICS) + return _cvtsh_ss(half); + #else + int64_t exp = (half >> 10) & 0x1f; + int64_t mant = half & 0x3ff; + double val; + if (exp == 0) { + val = ldexp(static_cast(mant), -24); } - const char* what() const noexcept override + else if (exp != 31) { - return std::runtime_error::what(); + val = ldexp(static_cast(mant) + 1024.0, static_cast(exp - 25)); + } + else + { + val = mant == 0 ? std::numeric_limits::infinity() : std::nan(""); } - }; + return half & 0x8000 ? -val : val; + #endif + } +} // namespace binary } // namespace jsoncons -#define JSONCONS_STR2(x) #x -#define JSONCONS_STR(x) JSONCONS_STR2(x) - -#ifdef _DEBUG -#define JSONCONS_ASSERT(x) if (!(x)) { \ - JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at " __FILE__ ":" \ - JSONCONS_STR(__LINE__))); } -#else -#define JSONCONS_ASSERT(x) if (!(x)) { \ - JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at <> :" \ - JSONCONS_STR( 0 ))); } -#endif // _DEBUG - -#if defined(JSONCONS_HAS_2017) -# define JSONCONS_FALLTHROUGH [[fallthrough]] -#elif defined(__clang__) -# define JSONCONS_FALLTHROUGH [[clang::fallthrough]] -#elif defined(__GNUC__) && ((__GNUC__ >= 7)) -# define JSONCONS_FALLTHROUGH __attribute__((fallthrough)) -#elif defined (__GNUC__) -# define JSONCONS_FALLTHROUGH // FALLTHRU -#else -# define JSONCONS_FALLTHROUGH -#endif - - #endif // JSONCONS_CONFIG_COMPILER_SUPPORT_HPP diff --git a/include/jsoncons/config/jsoncons_config.hpp b/include/jsoncons/config/jsoncons_config.hpp index dd26f175e..d6b257c6e 100644 --- a/include/jsoncons/config/jsoncons_config.hpp +++ b/include/jsoncons/config/jsoncons_config.hpp @@ -8,11 +8,53 @@ #define JSONCONS_CONFIG_JSONCONS_CONFIG_HPP #include +#include #include -#include #include +namespace jsoncons { + + class assertion_error : public std::runtime_error + { + public: + assertion_error(const std::string& s) noexcept + : std::runtime_error(s) + { + } + const char* what() const noexcept override + { + return std::runtime_error::what(); + } + }; + +} // namespace jsoncons + +#define JSONCONS_STR2(x) #x +#define JSONCONS_STR(x) JSONCONS_STR2(x) + +#ifdef _DEBUG +#define JSONCONS_ASSERT(x) if (!(x)) { \ + JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at " __FILE__ ":" \ + JSONCONS_STR(__LINE__))); } +#else +#define JSONCONS_ASSERT(x) if (!(x)) { \ + JSONCONS_THROW(jsoncons::assertion_error("assertion '" #x "' failed at <> :" \ + JSONCONS_STR( 0 ))); } +#endif // _DEBUG + +#if defined(JSONCONS_HAS_2017) +# define JSONCONS_FALLTHROUGH [[fallthrough]] +#elif defined(__clang__) +# define JSONCONS_FALLTHROUGH [[clang::fallthrough]] +#elif defined(__GNUC__) && ((__GNUC__ >= 7)) +# define JSONCONS_FALLTHROUGH __attribute__((fallthrough)) +#elif defined (__GNUC__) +# define JSONCONS_FALLTHROUGH // FALLTHRU +#else +# define JSONCONS_FALLTHROUGH +#endif + #if !defined(JSONCONS_HAS_STD_STRING_VIEW) #include namespace jsoncons { @@ -127,122 +169,6 @@ namespace jsoncons #endif // !defined(JSONCONS_HAS_STD_MAKE_UNIQUE) -namespace jsoncons { -namespace binary { - - // native_to_big - - template - typename std::enable_if::type - native_to_big(T val, OutputIt d_first) - { - uint8_t buf[sizeof(T)]; - std::memcpy(buf, &val, sizeof(T)); - for (auto item : buf) - { - *d_first++ = item; - } - } - - template - typename std::enable_if::type - native_to_big(T val, OutputIt d_first) - { - T val2 = byte_swap(val); - uint8_t buf[sizeof(T)]; - std::memcpy(buf, &val2, sizeof(T)); - for (auto item : buf) - { - *d_first++ = item; - } - } - - // native_to_little - - template - typename std::enable_if::type - native_to_little(T val, OutputIt d_first) - { - uint8_t buf[sizeof(T)]; - std::memcpy(buf, &val, sizeof(T)); - for (auto item : buf) - { - *d_first++ = item; - } - } - - template - typename std::enable_if::type - native_to_little(T val, OutputIt d_first) - { - T val2 = byte_swap(val); - uint8_t buf[sizeof(T)]; - std::memcpy(buf, &val2, sizeof(T)); - for (auto item : buf) - { - *d_first++ = item; - } - } - - // big_to_native - - template - typename std::enable_if::type - big_to_native(const uint8_t* first, std::size_t count) - { - if (sizeof(T) > count) - { - return T{}; - } - T val; - std::memcpy(&val,first,sizeof(T)); - return val; - } - - template - typename std::enable_if::type - big_to_native(const uint8_t* first, std::size_t count) - { - if (sizeof(T) > count) - { - return T{}; - } - T val; - std::memcpy(&val,first,sizeof(T)); - return byte_swap(val); - } - - // little_to_native - - template - typename std::enable_if::type - little_to_native(const uint8_t* first, std::size_t count) - { - if (sizeof(T) > count) - { - return T{}; - } - T val; - std::memcpy(&val,first,sizeof(T)); - return val; - } - - template - typename std::enable_if::type - little_to_native(const uint8_t* first, std::size_t count) - { - if (sizeof(T) > count) - { - return T{}; - } - T val; - std::memcpy(&val,first,sizeof(T)); - return byte_swap(val); - } - -} // binary -} // namespace jsoncons - namespace jsoncons { template diff --git a/include/jsoncons/utility/binary.hpp b/include/jsoncons/utility/binary.hpp index c23190fcc..98378a20a 100644 --- a/include/jsoncons/utility/binary.hpp +++ b/include/jsoncons/utility/binary.hpp @@ -1,10 +1,224 @@ #ifndef JSONCONS_UTILITY_BINARY_HPP #define JSONCONS_UTILITY_BINARY_HPP +#include +#include +#include +#include +#include // std::memcpy +#include +#include // std::enable_if + #include namespace jsoncons { +namespace binary { + + // byte_swap + + template + typename std::enable_if::value && sizeof(T) == sizeof(uint8_t),T>::type + byte_swap(T val) + { + return val; + } + + template + typename std::enable_if::value && sizeof(T) == sizeof(uint16_t),T>::type + byte_swap(T val) + { + #if defined(JSONCONS_BYTE_SWAP_16) + return JSONCONS_BYTE_SWAP_16(val); + #else + return (static_cast(val) >> 8) | (static_cast(val) << 8); + #endif + } + + template + typename std::enable_if::value && sizeof(T) == sizeof(uint32_t),T>::type + byte_swap(T val) + { + #if defined(JSONCONS_BYTE_SWAP_32) + return JSONCONS_BYTE_SWAP_32(val); + #else + uint32_t tmp = ((static_cast(val) << 8) & 0xff00ff00) | ((static_cast(val) >> 8) & 0xff00ff); + return (tmp << 16) | (tmp >> 16); + #endif + } + + template + typename std::enable_if::value && sizeof(T) == sizeof(uint64_t),T>::type + byte_swap(T val) + { + #if defined(JSONCONS_BYTE_SWAP_64) + return JSONCONS_BYTE_SWAP_64(val); + #else + uint64_t tmp = ((static_cast(val) & 0x00000000ffffffffull) << 32) | ((static_cast(val) & 0xffffffff00000000ull) >> 32); + tmp = ((tmp & 0x0000ffff0000ffffull) << 16) | ((tmp & 0xffff0000ffff0000ull) >> 16); + return ((tmp & 0x00ff00ff00ff00ffull) << 8) | ((tmp & 0xff00ff00ff00ff00ull) >> 8); + #endif + } + + template + typename std::enable_if::value && sizeof(T) == sizeof(uint32_t),T>::type + byte_swap(T val) + { + uint32_t x; + std::memcpy(&x,&val,sizeof(uint32_t)); + uint32_t y = byte_swap(x); + T val2; + std::memcpy(&val2,&y,sizeof(uint32_t)); + return val2; + } + + template + typename std::enable_if::value && sizeof(T) == sizeof(uint64_t),T>::type + byte_swap(T val) + { + uint64_t x; + std::memcpy(&x,&val,sizeof(uint64_t)); + uint64_t y = byte_swap(x); + T val2; + std::memcpy(&val2,&y,sizeof(uint64_t)); + return val2; + } + + struct uint128_holder + { + uint64_t lo; + uint64_t hi; + }; + + template + typename std::enable_if::value && sizeof(T) == 2*sizeof(uint64_t),T>::type + byte_swap(T val) + { + uint128_holder x; + uint8_t buf[2*sizeof(uint64_t)]; + std::memcpy(buf,&val,2*sizeof(uint64_t)); + std::memcpy(&x.lo,buf,sizeof(uint64_t)); + std::memcpy(&x.hi,buf+sizeof(uint64_t),sizeof(uint64_t)); + + uint128_holder y; + y.lo = byte_swap(x.hi); + y.hi = byte_swap(x.lo); + + T val2; + std::memcpy(&val2,&y,2*sizeof(uint64_t)); + + return val2; + } + // native_to_big + + template + typename std::enable_if::type + native_to_big(T val, OutputIt d_first) + { + uint8_t buf[sizeof(T)]; + std::memcpy(buf, &val, sizeof(T)); + for (auto item : buf) + { + *d_first++ = item; + } + } + + template + typename std::enable_if::type + native_to_big(T val, OutputIt d_first) + { + T val2 = byte_swap(val); + uint8_t buf[sizeof(T)]; + std::memcpy(buf, &val2, sizeof(T)); + for (auto item : buf) + { + *d_first++ = item; + } + } + + // native_to_little + + template + typename std::enable_if::type + native_to_little(T val, OutputIt d_first) + { + uint8_t buf[sizeof(T)]; + std::memcpy(buf, &val, sizeof(T)); + for (auto item : buf) + { + *d_first++ = item; + } + } + + template + typename std::enable_if::type + native_to_little(T val, OutputIt d_first) + { + T val2 = byte_swap(val); + uint8_t buf[sizeof(T)]; + std::memcpy(buf, &val2, sizeof(T)); + for (auto item : buf) + { + *d_first++ = item; + } + } + + // big_to_native + + template + typename std::enable_if::type + big_to_native(const uint8_t* first, std::size_t count) + { + if (sizeof(T) > count) + { + return T{}; + } + T val; + std::memcpy(&val,first,sizeof(T)); + return val; + } + + template + typename std::enable_if::type + big_to_native(const uint8_t* first, std::size_t count) + { + if (sizeof(T) > count) + { + return T{}; + } + T val; + std::memcpy(&val,first,sizeof(T)); + return byte_swap(val); + } + + // little_to_native + + template + typename std::enable_if::type + little_to_native(const uint8_t* first, std::size_t count) + { + if (sizeof(T) > count) + { + return T{}; + } + T val; + std::memcpy(&val,first,sizeof(T)); + return val; + } + + template + typename std::enable_if::type + little_to_native(const uint8_t* first, std::size_t count) + { + if (sizeof(T) > count) + { + return T{}; + } + T val; + std::memcpy(&val,first,sizeof(T)); + return byte_swap(val); + } +} // namespace binary } // namespace jsoncons #endif // JSONCONS_UTILITY_BINARY_HPP diff --git a/include/jsoncons_ext/bson/bson_encoder.hpp b/include/jsoncons_ext/bson/bson_encoder.hpp index 160597617..e87924d01 100644 --- a/include/jsoncons_ext/bson/bson_encoder.hpp +++ b/include/jsoncons_ext/bson/bson_encoder.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/include/jsoncons_ext/bson/bson_parser.hpp b/include/jsoncons_ext/bson/bson_parser.hpp index 681a8ad37..a8a39d3f6 100644 --- a/include/jsoncons_ext/bson/bson_parser.hpp +++ b/include/jsoncons_ext/bson/bson_parser.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include diff --git a/include/jsoncons_ext/cbor/cbor_encoder.hpp b/include/jsoncons_ext/cbor/cbor_encoder.hpp index 8adf7ffd0..90f7dd29b 100644 --- a/include/jsoncons_ext/cbor/cbor_encoder.hpp +++ b/include/jsoncons_ext/cbor/cbor_encoder.hpp @@ -18,6 +18,7 @@ #include // jsoncons::ser_error #include #include +#include #include #include diff --git a/include/jsoncons_ext/cbor/cbor_parser.hpp b/include/jsoncons_ext/cbor/cbor_parser.hpp index 73a3b5e3f..43715abc4 100644 --- a/include/jsoncons_ext/cbor/cbor_parser.hpp +++ b/include/jsoncons_ext/cbor/cbor_parser.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/include/jsoncons_ext/msgpack/msgpack_encoder.hpp b/include/jsoncons_ext/msgpack/msgpack_encoder.hpp index fd38d95df..788cf821b 100644 --- a/include/jsoncons_ext/msgpack/msgpack_encoder.hpp +++ b/include/jsoncons_ext/msgpack/msgpack_encoder.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/include/jsoncons_ext/msgpack/msgpack_parser.hpp b/include/jsoncons_ext/msgpack/msgpack_parser.hpp index 4d89ca236..8b69a2c45 100644 --- a/include/jsoncons_ext/msgpack/msgpack_parser.hpp +++ b/include/jsoncons_ext/msgpack/msgpack_parser.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/include/jsoncons_ext/ubjson/ubjson_encoder.hpp b/include/jsoncons_ext/ubjson/ubjson_encoder.hpp index 6836ea070..a0632fbb0 100644 --- a/include/jsoncons_ext/ubjson/ubjson_encoder.hpp +++ b/include/jsoncons_ext/ubjson/ubjson_encoder.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/include/jsoncons_ext/ubjson/ubjson_parser.hpp b/include/jsoncons_ext/ubjson/ubjson_parser.hpp index 9422db187..67b15d395 100644 --- a/include/jsoncons_ext/ubjson/ubjson_parser.hpp +++ b/include/jsoncons_ext/ubjson/ubjson_parser.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include