On 9/27/22 06:10, Jacek Caban (@jacek) wrote:
On Tue Sep 27 11:10:22 2022 +0000, RĂ©mi Bernon wrote:
It looks either like a reason to change our `FORCEINLINE` definition instead to match mingw-w64, and remove the static qualifiers everywhere, or an issue on the mingw-w64 side: Windows SDK also uses FORCEINLINE / __forceinline with `static` qualifier in some places.
Yeah, it's an issue in mingw-w64 which is hard to change there without breaking things. Anyway, I don't think we want to match mingw-w64 in Wine in this case.
The problem isn't really that FORCEINLINE is broken so much as that non-static inline is broken. MSVC "inline" has semantics that are impossible to match with current gcc. There's a more complete explanation at [1].
MSVC __forceinline is just MSVC inline plus an equivalent of the "always_inline" attribute, i.e. it inlines even without -finline. I'm not opposed to adding always_inline here, but it doesn't seem necessary.
Incidentally, I remember searching for FORCEINLINE in the Windows SDK, and I never saw it used with static or extern. What examples did you see there?
[1] https://sourceforge.net/p/mingw-w64/mailman/message/37685650/