Robert Shearman <rob@codeweavers.com> wrote:
Joris Huizer wrote:
> Hello,
>
> I was looking at the result of configuring with -ansi,
> -pedantic flags. It gives loads of warnings (not all
> relevant - also complaining about 'long long' not
> being ansi) and indicates unnamed unions, among other
> things.
> Could someone confirm my idea that unnamed unions must
> all be dealt with? Am hoping to fix those if I get it
> to compile thus far;
>
> At this point, it complains about
> include/wine/unicode.h which has the combination
> 'extern' and 'inline', which it doesn't like.
> Getting rid of that, with -Dinline=__inline__, helps
> it get a bit further
>
> Next it complains about is libs/wine/string.c, which
> implements several functions that are also implemented
> in include/wine/unicode.h. These are again the 'extern
> inline' functions.
>
> As most headers have 'static inline' instead of
> 'extern inline', with the advantage of not having to
> duplicate the functions. I'm hoping this is an allowed
> fix, it gets compiling further anyway
>

On modern CPUs it is much better to have one copy of the function
instead of inlining it. Making the functions static instead of extern
will probably cause wine to be a bit slower at the expense of silencing
some not very useful warnings. If you want to fix it for this case, I
suggest you add a define that changes to "static inline" if
pedantic/ansi mode is being used and "extern inline" otherwise and use
it when declaring the functions.

--
Rob Shearman

Well if it isn't applied (btw how could I see what is/isn't applied?) will try to look at that.

Though the keyword "inline" implies the code should get inlined, and if it shouldn't, the implementation copy should be removed from the unicode.h file

Joris


Have a burning question? Go to Yahoo! Answers and get answers from real people who know.