<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><P>Hi guys,</P><P>There is also a mixed approach by using the preprocessor... for the inline qualifier only :)</P><P></P><P>MSVC:</P><P>#define FORCE_INLINE __forceinline<BR></P><P>G++:</P><P>#define FORCE_INLINE __attribute__((always_inline))</P><P></P><BR>--- En date de : <B>Jeu 13.11.08, Max Horn <I><max@quendi.de></I></B> a écrit :<BR><BLOCKQUOTE style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">De: Max Horn <max@quendi.de><BR>Objet: Re: [Scummvm-devel] ScummVM binary size comparison<BR>À: "David Given" <dg@cowlark.com><BR>Cc: "ScummVM devel" <scummvm-devel@lists.sourceforge.net><BR>Date: Jeudi 13 Novembre 2008, 19h01<BR><BR><PRE>Am 13.11.2008 um 18:08 schrieb David Given:

> Max Horn wrote:
> [...]
>> Welll, I already implemented the "inline" version, at least
GCC seems
>> to honor it just fine (at least when building with -Os or any other
>> non-zero optimization level). I would also expect MSVC to do so. As
>> Johannes said, if we encounter a compiler which has troubles with
>> this, we can still change it to the macro approach :)
>
> Don't forget the new C/C++ vararg macro support; that'll provide a
> syntax-compatible alternate implementation.

> It also has the advantage that if faced with a really ancient compiler
> that does neither empty inlines nor vararg macros, it should be
> relatively straightforward to bolt on a third-party preprocessor and
> make them work that way.

I wouldn't consider it an acceptable solution to potentially force  
people who want to port ScummVM to "exotic" systems to "bolt
on" a 3rd  
party preprocessor. It seems to have to more or less the same drawback  
as the "use inline function" approach (not supported by all  
compilers), only worse: No easy fallback (if the compiler doesn't  
implement / optimize inline properly, it still compilers), and I  
believe less compilers support varadic macros.


For now, let's just continue as-is, and if we find a port where the  
compiler does not optimize empty inline functions away properly, we  
can still reconsider. Really, folks, the code is already in  
Subversion, so, unless you know any system on which it causes  
troubles, let's put this to the rest, and let's focus on more  
important issues, e.g. the color of the bikeshed. *ggg*.

Bye,
Max

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Scummvm-devel mailing list
Scummvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scummvm-devel
</PRE></BLOCKQUOTE></td></tr></table><br>