mirror of
https://github.com/cc65/cc65.git
synced 2025-02-09 02:30:42 +00:00
Don't rely on (actually changed) unspecified compiler behavior.
This commit is contained in:
parent
6a76d6d905
commit
2235830e31
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user