https://git.reactos.org/?p=reactos.git;a=commitdiff;h=87a5311116764f1a834c4…
commit 87a5311116764f1a834c45ef35861612e18eb372
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Thu Sep 24 05:33:35 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Thu Sep 24 05:33:35 2020 +0300
[SDK] Fix __forceinline definition for C++
---
sdk/include/crt/_mingw.h | 10 +++++++---
sdk/include/psdk/intsafe.h | 8 --------
sdk/include/xdk/ntbasedef.h | 8 +-------
3 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/sdk/include/crt/_mingw.h b/sdk/include/crt/_mingw.h
index b63e0b3b17a..06a304d9605 100644
--- a/sdk/include/crt/_mingw.h
+++ b/sdk/include/crt/_mingw.h
@@ -190,10 +190,14 @@ allow GCC to optimize away some EH unwind code, at least in DW2
case. */
# endif
# define __ptr32
# define __ptr64
-# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
-# define __forceinline extern inline __attribute__((__always_inline__,__gnu_inline__))
+# ifdef __cplusplus
+# define __forceinline inline __attribute__((__always_inline__))
# else
-# define __forceinline extern __inline__ __attribute__((__always_inline__))
+# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
+# define __forceinline extern inline __attribute__((__always_inline__,__gnu_inline__))
+# else
+# define __forceinline extern __inline__ __attribute__((__always_inline__))
+# endif
# endif
#endif
diff --git a/sdk/include/psdk/intsafe.h b/sdk/include/psdk/intsafe.h
index e30cb1182af..10fb173beb5 100644
--- a/sdk/include/psdk/intsafe.h
+++ b/sdk/include/psdk/intsafe.h
@@ -30,14 +30,6 @@
#include <specstrings.h>
-#if defined(__GNUC__) && !defined(__forceinline)
-# if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
-# define __forceinline extern inline __attribute__((__always_inline__,__gnu_inline__))
-# else
-# define __forceinline extern __inline__ __attribute__((__always_inline__))
-# endif
-#endif
-
/* Handle ntintsafe here too */
#ifdef _NTINTSAFE_H_INCLUDED_
#ifndef _NTDEF_ /* Guard agains redefinition from ntstatus.h */
diff --git a/sdk/include/xdk/ntbasedef.h b/sdk/include/xdk/ntbasedef.h
index a7d0935a8fd..2118935a35c 100644
--- a/sdk/include/xdk/ntbasedef.h
+++ b/sdk/include/xdk/ntbasedef.h
@@ -213,13 +213,7 @@
/* Inlines */
#ifndef FORCEINLINE
- #if defined(_MSC_VER)
- #define FORCEINLINE __forceinline
- #elif ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
- #define FORCEINLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
- #else
- #define FORCEINLINE extern __inline__ __attribute__((__always_inline__))
- #endif
+ #define FORCEINLINE __forceinline
#endif /* FORCEINLINE */
#ifndef DECLSPEC_NOINLINE