Correctly configure NXT_ENABLE_ASSERTS on multiconfiguration generators (#88)

And also set a default build type for single-configuration generators
This commit is contained in:
Kai Ninomiya
2017-07-20 07:28:00 -07:00
committed by GitHub
parent 35bf424035
commit 59dc03f101
4 changed files with 15 additions and 7 deletions

View File

@@ -62,7 +62,9 @@ void* AlignVoidPtr(void* ptr, size_t alignment) {
}
uint32_t Align(uint32_t value, size_t alignment) {
ASSERT(alignment <= UINT32_MAX);
ASSERT(IsPowerOfTwo(alignment));
ASSERT(alignment != 0);
return (value + (alignment - 1)) & ~(alignment - 1);
uint32_t alignment32 = static_cast<uint32_t>(alignment);
return (value + (alignment32 - 1)) & ~(alignment32 - 1);
}