[Ffmpeg-devel] always_inline macro

rob arnold rob
Wed Sep 6 23:07:05 CEST 2006

In the latest SVN (but also going all the way back into the CVS days)  
in common.h there is:

#ifndef always_inline
#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 &&  
__GNUC_MINOR__ > 0)
#    define always_inline __attribute__((always_inline)) inline
#    define always_inline inline

but then, anyone afterwards using the __attribute__((always_inline))  
call gets an error.

For instance,

#include <config.h>
#include <math.h>  // standard include

^--- will spew compiler errors

shouldn't always_inline be of a more guarded form (or at the least,  
not be a name that is known used by many gcc files)?  For instance:

#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 &&  
__GNUC_MINOR__ > 0)
#    define FFMPEG_ALWAYS_INLINE __attribute__((always_inline)) inline
#    define FFMPEG_ALWAYS_INLINE inline

then replace all the always_inline occurrences in the project files  

When googling, I found a few other references to other people hitting  
this issue, but didn't see a discussion on it on any ffmpeg links.    
I don't see how the current definition could be considered a good  
thing given ffmpeg is often used as a library and other code is  
extremely likely to include always_inline in the text, but it seems  
surprising that this would not have already been reported and  
discussed.  If it has been, and I've missed it by not having a good  
means to search mailing list archives, my apologies.

More information about the ffmpeg-devel mailing list