diff options
| author | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2014-11-29 20:42:22 +0300 |
|---|---|---|
| committer | Andrew Ryabinin <ryabinin.a.a@gmail.com> | 2014-11-29 20:59:18 +0300 |
| commit | d1fcfe950a70ddbdd97164832cdb83ef2cc7f23a (patch) | |
| tree | 23609f57eb348822a492e1d7e6c39f57b76c4111 | |
| parent | d924c83066759792f8a7622ed8794a97ca98bf4b (diff) | |
| download | rockbox-d1fcfe950a70ddbdd97164832cdb83ef2cc7f23a.zip rockbox-d1fcfe950a70ddbdd97164832cdb83ef2cc7f23a.tar.gz rockbox-d1fcfe950a70ddbdd97164832cdb83ef2cc7f23a.tar.bz2 rockbox-d1fcfe950a70ddbdd97164832cdb83ef2cc7f23a.tar.xz | |
Add IS_ALIGNED(x, a) macro helper
Change-Id: Ic5799e4bc03cabddece80cbc129b16f3a19ff9c5
| -rw-r--r-- | firmware/export/system.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h index 47dd858..e83ee53 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h @@ -134,6 +134,8 @@ int get_cpu_boost_counter(void); (size) = __a2 > __a1 ? __a2 - __a1 : 0; \ }) +#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) + #define PTR_ADD(ptr, x) ((typeof(ptr))((char*)(ptr) + (x))) #define PTR_SUB(ptr, x) ((typeof(ptr))((char*)(ptr) - (x))) |