I still need to run some test, but I it seems ready for review.

The important change is __forceinline. We add extern to GCC macro,
because that matches closer intended behaviour. clang supports
__forceinline itself if -fms-extensions is used, so we should just leave
it to the compiler in that case (also __ptr32, __unaligned and __w64, so
I changed them as well while I was at it). Without -fms-extensions,
__always_inline__ is expected and as far as I can tell (and my testing
conforms that), it matches intended behaviour without additional attributes.

Signed-off-by: Jacek Caban <ja...@codeweavers.com>
---
 mingw-w64-headers/crt/_mingw.h.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mingw-w64-headers/crt/_mingw.h.in b/mingw-w64-headers/crt/_mingw.h.in
index 4c40da0c..98239c39 100644
--- a/mingw-w64-headers/crt/_mingw.h.in
+++ b/mingw-w64-headers/crt/_mingw.h.in
@@ -251,7 +251,7 @@ typedef int __int128 __attribute__ ((__mode__ (TI)));
 #endif /* __GNUC__ */
 #endif /* _INT128_DEFINED */
 
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(_MSC_EXTENSIONS)
 #define __ptr32
 #define __ptr64
 #ifndef __unaligned
@@ -262,6 +262,8 @@ typedef int __int128 __attribute__ ((__mode__ (TI)));
 #endif
 #ifdef __cplusplus
 #define __forceinline inline __attribute__((__always_inline__))
+#elif defined (__clang__)
+#define __forceinline __attribute__((__always_inline__))
 #else
 #define __forceinline extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
 #endif /* __cplusplus */

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to