configure: Change check for uint128_t
authorDavid Schleef <ds@schleef.org>
Mon, 5 Apr 2010 20:46:23 +0000 (13:46 -0700)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Mon, 12 Apr 2010 23:00:41 +0000 (00:00 +0100)
Check for ability to divide uint128_t values, since that what
we actually use it for (in gstutils.c).  The existence of a
uint128_t type doesn't mean the compiler can actually generate
code for it.  Also make sure that we can actually link the
result successfully.

Fixes bug #614767.

configure.ac

index b96d2dd..3abbee3 100644 (file)
@@ -320,12 +320,14 @@ dnl *** checks for structures ***
 dnl *** checks for compiler characteristics ***
 
 dnl check if the compiler supports __uint128_t (gcc)
+dnl Actually check for 128-bit division, since that's what we use
+dnl uint128_t for.
 AC_CACHE_CHECK(for __uint128_t, gst_cv_uint128_t,
-    AC_TRY_COMPILE([ ], [
-      unsigned long long v1 = 1024ULL;
-      unsigned long long v2 = 0x8000000000000000ULL;
-      __uint128_t u = ((__uint128_t)v1)*((__uint128_t)v2);
-
+    AC_TRY_LINK([ ], [
+      static __uint128_t v1 = 100;
+      static __uint128_t v2 = 10;
+      static __uint128_t u;
+      u = v1 / v2;
       return 0;
     ], [
       gst_cv_uint128_t=yes