[x264-devel] Fix building with older versions of GCC.

Brad brad at comstyle.com
Mon Jan 5 02:45:08 CET 2009


While trying to update to a newer x264 snapshot I noticed the build
is broken since it is attempting to use a built-in GCC function
which was introduced with GCC 3.4. The following diff fixes the
build.


--- common/osdep.h.orig	Sat Jan  3 16:45:09 2009
+++ common/osdep.h	Sun Jan  4 16:52:39 2009
@@ -170,7 +170,7 @@ static ALWAYS_INLINE intptr_t endian_fix( intptr_t x )
 }
 #endif
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 3)
 #define x264_clz(x) __builtin_clz(x)
 #else
 static int ALWAYS_INLINE x264_clz( uint32_t x )

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the x264-devel mailing list