Implement a proper configure test for AltiVec vector declaration syntax.
authorDiego Biurrun <diego@biurrun.de>
Fri, 30 May 2008 10:58:48 +0000 (10:58 +0000)
committerDiego Biurrun <diego@biurrun.de>
Fri, 30 May 2008 10:58:48 +0000 (10:58 +0000)
Originally committed as revision 13555 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure
libavutil/internal.h

index c50e92bf9fd5e8d7a7d051e7a36c49a106327f80..c4b64515dc42b59fcbb86996a834ff9801f8faae 100755 (executable)
--- a/configure
+++ b/configure
@@ -714,6 +714,7 @@ HAVE_LIST="
     $ARCH_EXT_LIST
     $THREADS_LIST
     altivec_h
+    altivec_vector_braces
     arpa_inet_h
     bswap
     byteswap_h
@@ -1542,6 +1543,13 @@ int main(void) {
     v1 = vec_add(v2,v3);
     return 0;
 }
+EOF
+
+    # check if our compiler supports braces for vector declarations
+    check_cc <<EOF && enable altivec_vector_braces
+$inc_altivec_h
+#define AVV(x...) {x}
+int main (void) { (vector int) AVV(1); return 0; }
 EOF
 fi
 
index 8e4f81b244d9bea0c7280e4edbeffd82499b87a7..35589fa4f94a10f38a25a1c074be40e5424c93d7 100644 (file)
 #endif
 #endif
 
-/* Use Apple-specific AltiVec syntax for vector declarations when necessary. */
-#ifdef __APPLE_CC__
-#define AVV(x...) (x)
-#else
+#ifdef HAVE_ALTIVEC_VECTOR_BRACES
 #define AVV(x...) {x}
+#else
+#define AVV(x...) (x)
 #endif
 
 #ifndef M_PI