Support MSVC cli.

MSVC CLI defined their own nullptr and provides for __nullptr for standard C++11.
https://msdn.microsoft.com/en-us/library/4ex65770.aspx
msgpack-c introduce MSGPACK_NULLPTR for internal use, it is defined as __nullptr only if compiled on C++ CLI otherwise defined as nullptr.
This commit is contained in:
Takatoshi Kondo
2016-06-08 09:41:18 +09:00
parent ca5ef097ac
commit 0f66e144ab
44 changed files with 186 additions and 176 deletions

View File

@@ -170,7 +170,7 @@ TEST(unpack, int_pointer_off_no_ref_explicit)
std::size_t off = 0;
// obsolete
msgpack::unpack(&oh, sbuf.data(), sbuf.size(), &off, nullptr);
msgpack::unpack(&oh, sbuf.data(), sbuf.size(), &off, MSGPACK_NULLPTR);
EXPECT_EQ(1, oh.get().as<int>());
EXPECT_EQ(off, sbuf.size());
}
@@ -183,7 +183,7 @@ TEST(unpack, int_pointer_no_off_ref)
bool referenced;
// obsolete
msgpack::unpack(&oh, sbuf.data(), sbuf.size(), nullptr, &referenced);
msgpack::unpack(&oh, sbuf.data(), sbuf.size(), MSGPACK_NULLPTR, &referenced);
EXPECT_EQ(1, oh.get().as<int>());
EXPECT_EQ(false, referenced);
}