From: Andre Noll Date: Mon, 21 Dec 2009 18:21:13 +0000 (+0100) Subject: __aligned is already defined on NetBSD. X-Git-Tag: v0.4.1~3 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=18483260c9f20ed4a79a9aa146d46e81b99c3e6e;hp=9f7aecdbca21d6cadfe36ac46f6f0dada92ce8f2 __aligned is already defined on NetBSD. Use __a_aligned in analogy to __a_unused which was introduced since __unused is already defined on MacOS. This fixes the warning gcc-compat.h:5:1: warning: "__aligned" redefined In file included from /usr/include/regex.h:77, from daemon.c:9: /usr/include/sys/cdefs.h:202:1: warning: this is the location of the previous definition on NetBSD and has the additional advantage that it keeps working even if the NetBSD people decide to redefine __aligned. --- diff --git a/gcc-compat.h b/gcc-compat.h index 7367173a..ffd714f7 100644 --- a/gcc-compat.h +++ b/gcc-compat.h @@ -2,7 +2,7 @@ #define __noreturn __attribute__ ((noreturn)) #define __malloc __attribute__ ((malloc)) #define __a_unused __attribute__ ((unused)) -#define __aligned(alignment) __attribute__((__aligned__(alignment))) +#define __a_aligned(alignment) __attribute__((__aligned__(alignment))) /* * p is the number of the "format string" parameter, and q is diff --git a/imdct.c b/imdct.c index 3495e611..5f48ba44 100644 --- a/imdct.c +++ b/imdct.c @@ -59,7 +59,7 @@ struct mdct_context { }; /** cos(2 * pi * x / n) for 0 <= x <= n / 4, followed by its reverse */ -#define COSINE_TAB(n) fftsample_t cos_ ## n[n / 2] __aligned(16) +#define COSINE_TAB(n) fftsample_t cos_ ## n[n / 2] __a_aligned(16) COSINE_TAB(16); COSINE_TAB(32); diff --git a/wmadec_filter.c b/wmadec_filter.c index 1a4dc5e7..b78d7627 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -148,7 +148,7 @@ struct private_wmadec_data { #define VLCBITS 9 #define VLCMAX ((22 + VLCBITS - 1) / VLCBITS) -#define SINE_WINDOW(x) float sine_ ## x[x] __aligned(16) +#define SINE_WINDOW(x) float sine_ ## x[x] __a_aligned(16) SINE_WINDOW(128); SINE_WINDOW(256);