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

@@ -33,7 +33,7 @@ private:
void* m_data;
};
struct finalizer_array {
finalizer_array():m_tail(nullptr), m_end(nullptr), m_array(nullptr) {}
finalizer_array():m_tail(MSGPACK_NULLPTR), m_end(MSGPACK_NULLPTR), m_array(MSGPACK_NULLPTR) {}
void call() {
finalizer* fin = m_tail;
for(; fin != m_array; --fin) (*(fin-1))();
@@ -84,9 +84,9 @@ private:
finalizer_array(finalizer_array&& other) noexcept
:m_tail(other.m_tail), m_end(other.m_end), m_array(other.m_array)
{
other.m_tail = nullptr;
other.m_end = nullptr;
other.m_array = nullptr;
other.m_tail = MSGPACK_NULLPTR;
other.m_end = MSGPACK_NULLPTR;
other.m_array = MSGPACK_NULLPTR;
}
finalizer_array& operator=(finalizer_array&& other) noexcept
{
@@ -117,7 +117,7 @@ private:
m_head = c;
m_free = chunk_size;
m_ptr = reinterpret_cast<char*>(c) + sizeof(chunk);
c->m_next = nullptr;
c->m_next = MSGPACK_NULLPTR;
}
~chunk_list()
{
@@ -141,14 +141,14 @@ private:
break;
}
}
m_head->m_next = nullptr;
m_head->m_next = MSGPACK_NULLPTR;
m_free = chunk_size;
m_ptr = reinterpret_cast<char*>(m_head) + sizeof(chunk);
}
chunk_list(chunk_list&& other) noexcept
:m_free(other.m_free), m_ptr(other.m_ptr), m_head(other.m_head)
{
other.m_head = nullptr;
other.m_head = MSGPACK_NULLPTR;
}
chunk_list& operator=(chunk_list&& other) noexcept
{