[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
#else
#    define always_inline inline
#endif
#endif

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

For instance,

test.c:
#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:

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

then replace all the always_inline occurrences in the project files  
with FFMPEG_ALWAYS_INLINE


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