Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmansk...@oracle.com>
---
 include/compiler.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/compiler.h b/include/compiler.h
index ec714fe..4b41f65 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -15,4 +15,10 @@
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
 #endif
 
+/* Round x to the next multiple of a.
+ * a should be a power of 2.
+ */
+#define LTP_ALIGN(x, a)    __LTP_ALIGN_MASK(x, (typeof(x))(a) - 1)
+#define __LTP_ALIGN_MASK(x, mask)  (((x) + (mask)) & ~(mask))
+
 #endif /* __LTP_COMPILER_H__ */
-- 
1.7.1


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to