]> code.delx.au - pulseaudio/commitdiff
macro: add macro to align variables
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 26 Aug 2009 17:29:56 +0000 (19:29 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 27 Aug 2009 08:44:53 +0000 (10:44 +0200)
src/pulsecore/macro.h

index 87684ad3d3641cfafc2012b3574a7fab5951a61b..bffcc2642383bfcd3b4933aec0ba837d9be45842 100644 (file)
@@ -80,6 +80,12 @@ static inline size_t PA_PAGE_ALIGN(size_t l) {
 
 #define PA_ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0]))
 
+#if defined(__GNUC__)
+    #define PA_DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
+#else
+    #define PA_DECLARE_ALIGNED(n,t,v)      t v
+#endif
+
 /* The users of PA_MIN and PA_MAX, PA_CLAMP, PA_ROUND_UP should be
  * aware that these macros on non-GCC executed code with side effects
  * twice. It is thus considered misuse to use code with side effects