Here is a patch to handle AltiVec vector declaration syntax in a
slightly better way. Yes, this reverts a patch I sent earlier :)
Apple's gcc accepts vector declarations with () instead of {} like the
FSF gcc. Newer variants of the Apple compiler understand {} as well and
complain about () when compiling with -maltivec, which is the portable
and thus preferred flag. Thus {} should be used where possible.
AFAIK altivec.h is always necessary when compiling with -maltivec, thus
checking for ALTIVEC_H is better than __APPLE_CC__.
A cleaner solution would be to have a small test program in configure
like
#include <altivec.h>
#define AVV(x...) {x}
int main (void) { (vector int) AVV(1); return 0; }
and if it compiles successfully, set a HAVE_ALTIVEC_VECTOR_BRACES to 1
in config.h. I have done this for FFmpeg and MPlayer, but I have to
admit I do not know how to hack this into your autoconf scripts.
In the meantime, my proposed patch should be a rather reasonable
workaround.
Diego
Index: libmpeg2/idct_altivec.c
===================================================================
--- libmpeg2/idct_altivec.c (revision 1172)
+++ libmpeg2/idct_altivec.c (working copy)
@@ -56,10 +56,10 @@
#define vec_mergel my_vec_mergel
#endif
-#if defined(__APPLE_CC__) /* apple */
+#ifdef HAVE_ALTIVEC_H /* gnu */
+#define VEC_S16(a,b,c,d,e,f,g,h) {a, b, c, d, e, f, g, h}
+#else /* apple */
#define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) (a, b, c, d, e, f, g, h)
-#else /* gnu */
-#define VEC_S16(a,b,c,d,e,f,g,h) {a, b, c, d, e, f, g, h}
#endif
static const vector_s16_t constants ATTR_ALIGN(16) =
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Libmpeg2-devel mailing list
Libmpeg2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmpeg2-devel