Don't rely on (actually changed) unspecified compiler behavior.

This commit is contained in:
Oliver Schmidt
2021-12-19 16:44:37 +01:00
committed by mrdudz
parent a08f9e51a0
commit 152241f26c

View File

@@ -75,7 +75,7 @@ int __fastcall__ posix_memalign (void** memptr, size_t alignment, size_t size)
} }
/* Test alignment: is it a power of two? There must be only one bit set. */ /* Test alignment: is it a power of two? There must be only one bit set. */
if (alignment == 0 || (alignment & --alignment) != 0) { if (alignment == 0 || (alignment & alignment - 1) != 0) {
*memptr = NULL; *memptr = NULL;
return EINVAL; return EINVAL;
} }