Wine and C99 inline incompatibility

Vitaliy Margolen wine-devel at
Mon Jul 2 22:56:33 CDT 2007

Alexandre Julliard wrote:
> Zephiris <zephiris at> writes:
>> Specifically, this appears to conflict with, say, when
>> InterlockedExchange is actually defined later in the source file. Even
>> if 'extern inline' is replaced by 'static inline', that's a
>> problem. For that particular case, for instance, I tried to work
>> around by only exporting separate extern declaration if _KERNEL32_ is
>> defined, otherwise define the static inline part, since
>> InterlockedExchange needs to be exported.
>> But not so amusingly, the tools (loader, programs, etc) don't export
>> __WINESRC__, so can't bring in the inlined definitions. I'm not quite
>> sure how the GCC version of thing gets around that, as the extern
>> inline versions aren't exported, and the tools don't depend on
>> -kernel32.
> Since the extern inline functions are inside a #ifdef __GNUC__ they
> should be invisible to other compilers, which will use the global
> definitions in kernel32/sync.c. The tools don't call Interlocked*
> functions so they can't have a problem no matter which compiler is
> used. I don't understand your problem, what exactly is not working?

As I recall the problem was with the way InterlockedExchangePointer() and 
InterlockedCompareExchangePointer() are defined. I'm guessing 
compiler/linker can't optimize this away, if they are not used. And lots of 
programs in tools/ do include the winbase.h.


More information about the wine-devel mailing list