[mythtv] OSX backend beta test

David Abrahams dave at boost-consulting.com
Sun Jan 8 19:26:17 UTC 2006

Daniel Kristjansson <danielk at cuymedia.net> writes:

> On Sun, 2006-01-08 at 11:20 -0500, David Abrahams wrote:
>> Daniel Kristjansson <danielk at cuymedia.net> writes:
>> > On Sat, 2006-01-07 at 16:56 -1000, David Abrahams wrote:
>> >> * As noted in numerous places in my patch, the project's use of 
>> >> 
>> >>     #define always_inline
>> >> 
>> >>   is problematic.  That practice should end; for now it's worked
>> >>   around through careful management of #include order and a
>> >>   strategically-placed #undef always_inline
>> > Not a MythTV problem; you need to make your case with the ffmpeg people.
>> >
>> > They are much more ornery than us, so steel yourself. :)
>> Err, wait a minute.  The MythTV configure script generates 
>>      #define always_inline
>> Isn't that part, at least, our problem?
>> Are you saying that even if we fix that, FFMPEG is still #defining
>> always_inline in their headers?
> This is an inherited problem from ffmpeg, grep the code for
> always_inline.. And yes it is defined in libs/libavutil/common.h
> if we don't do it.. Our ./configure is a modification of the
> ffmpeg configure, we are just aping their always_inline handling.
> What is going on here is that some functions should always be
> inlined, but depending on the compiler there are different
> keywords or attributes to achieve this. 

Yes, I understand what's going on, thanks.

> gcc for instance has
> the function attribute 'always_inline', 

Yes, that's part of the problem.  The GCC people should have used a
__reserved_identifier__.  But then, FFMPEG should have used
PREFIXED_ALL_UPPER_CASE anyway, to stay out of the way of user

> while icc does not
> respect that attribute (and does not have it at all in earlier
> versions). If the MacOSX system headers define always_inline

They do not.  Apple just uses always_inline in legal ways that are
incompatible with the way that FFMPEG (and we) are #defining it.  

> then the ffmpeg version must be renamed to something like
> ALWAYS_INLINE, and in the case of OSX, simply be defined as
> always_inline.

No, that wouldn't work.  It would have to be 

    #define FFMPEG_ALWAYS_INLINE  __attribute__((always_inline))


    #define FFMPEG_ALWAYS_INLINE __inline__ __attribute__((always_inline))

> But this is something to discuss in the ffmeg mailing list, 

Okay, will do.

> since the developers there may have some reason for not doing 
> this, or they may simply not know that OSX uses this define.

In principle, it's not just an OSX issue.  Any code that uses GCC's
always_inline feature in the same legal ways as OSX will have the same

Dave Abrahams
Boost Consulting

More information about the mythtv-dev mailing list