On 64bit systems casting to long may result in a truncation of data resulting in an incorrect alignment
@@ -887,7 +887,7 @@ static void show_error(void)
static void *align(void *ptr, DWORD alig)
{
- ULONG ul = (ULONG)ptr;
+ uintptr_t ul = (uintptr_t)ptr;
ul += alig;
ul &= ~alig;
return ((void *)ul);