diff options
author | Christopher Ferris <cferris@google.com> | 2014-06-13 13:57:51 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2014-06-18 14:23:46 -0700 |
commit | 03eebcb6e8762e668a0d3af6bb303cccb88c5b81 (patch) | |
tree | 3c5053d90eb3d1fac8c21fa390367a911e188191 /libc/private/bionic_macros.h | |
parent | 64dfbd242cddc3ef95576e27e3940d68b89b5fce (diff) | |
download | bionic-03eebcb6e8762e668a0d3af6bb303cccb88c5b81.zip bionic-03eebcb6e8762e668a0d3af6bb303cccb88c5b81.tar.gz bionic-03eebcb6e8762e668a0d3af6bb303cccb88c5b81.tar.bz2 |
Move common macros into bionic_macros.h.
Bug: 15590152
Change-Id: I730636613ef3653f68c5ab1d43b53beaf8e0dc25
Diffstat (limited to 'libc/private/bionic_macros.h')
-rw-r--r-- | libc/private/bionic_macros.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/private/bionic_macros.h b/libc/private/bionic_macros.h index 34da501..a3a6985 100644 --- a/libc/private/bionic_macros.h +++ b/libc/private/bionic_macros.h @@ -33,4 +33,10 @@ TypeName(); \ DISALLOW_COPY_AND_ASSIGN(TypeName) +#define BIONIC_ALIGN(value, alignment) \ + (((value) + (alignment) - 1) & ~((alignment) - 1)) + +#define BIONIC_ROUND_UP_POWER_OF_2(value) \ + (1UL << (sizeof(value) * 8 - 1 - __builtin_clz(value))) + #endif // _BIONIC_MACROS_H_ |