mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-31 00:13:01 +08:00
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);
|
||||
|
||||
// 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
|
||||
void* page_memory = reinterpret_cast<void*>((reinterpret_cast<uintptr_t>(_memory) + (impl::xml_memory_page_alignment - 1)) & ~(impl::xml_memory_page_alignment - 1));
|
||||
|
Loading…
x
Reference in New Issue
Block a user