Replace offsetof with sizeof since some compilers don't recognize offsetof as a compile-time constant expression
git-svn-id: http://pugixml.googlecode.com/svn/trunk@959 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
7f6b062e9f
commit
4d8974f1fd
@ -5240,7 +5240,7 @@ namespace pugi
|
|||||||
assert(!_root);
|
assert(!_root);
|
||||||
|
|
||||||
// initialize sentinel page
|
// initialize sentinel page
|
||||||
PUGI__STATIC_ASSERT(offsetof(impl::xml_memory_page, data) + sizeof(impl::xml_document_struct) + impl::xml_memory_page_alignment <= sizeof(_memory));
|
PUGI__STATIC_ASSERT(sizeof(impl::xml_memory_page) + sizeof(impl::xml_document_struct) + impl::xml_memory_page_alignment <= sizeof(_memory));
|
||||||
|
|
||||||
// align upwards to page boundary
|
// align upwards to page boundary
|
||||||
void* page_memory = reinterpret_cast<void*>((reinterpret_cast<uintptr_t>(_memory) + (impl::xml_memory_page_alignment - 1)) & ~(impl::xml_memory_page_alignment - 1));
|
void* page_memory = reinterpret_cast<void*>((reinterpret_cast<uintptr_t>(_memory) + (impl::xml_memory_page_alignment - 1)) & ~(impl::xml_memory_page_alignment - 1));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user