From fd4e6f9c2601f881cad474bacc635145cb3a369c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 9 Mar 2016 16:54:43 +0000 Subject: [PATCH] [PSDK][XDK] - Add few missing #ifdef __GNUC__ before including msvctarget.h. - The contents of intrin.h is included only if RC_INVOKED is not defined. Compatible with MinGW and WinSDK. - Ignore PROBE_ALIGNMENT definition if no platform is defined, in case RC_INVOKED is defined. Compatible with MinGW and latest WinSDK. The two last fixes are also necessary to not make the Visual Studio resource compiler complain when a resource file is opened in it. svn path=/trunk/; revision=70984 --- reactos/include/crt/intrin.h | 4 +++- reactos/include/psdk/basetsd.h | 2 ++ reactos/include/xdk/ntbasedef.h | 4 ++-- reactos/include/xdk/winnt.template.h | 2 ++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/reactos/include/crt/intrin.h b/reactos/include/crt/intrin.h index 96bb4d79f56..8b474ba9823 100644 --- a/reactos/include/crt/intrin.h +++ b/reactos/include/crt/intrin.h @@ -2,6 +2,8 @@ #pragma once #define __INTRIN_H_ +#ifndef RC_INVOKED + #include #include #include @@ -1009,7 +1011,6 @@ long _InterlockedIncrement(_Interlocked_operand_ long volatile * _Addend); } #endif /* __cplusplus */ -#ifndef RC_INVOKED #if defined(__GNUC__) && defined(_WIN32) // We can't use __MINGW32__ here # include "mingw32/intrin.h" #elif defined(_MSC_VER) @@ -1017,4 +1018,5 @@ long _InterlockedIncrement(_Interlocked_operand_ long volatile * _Addend); #else # error Please implement intrinsics for your target compiler #endif + #endif diff --git a/reactos/include/psdk/basetsd.h b/reactos/include/psdk/basetsd.h index 1dd0c7f5fc5..2ac1e11afae 100644 --- a/reactos/include/psdk/basetsd.h +++ b/reactos/include/psdk/basetsd.h @@ -2,7 +2,9 @@ #define _BASETSD_H_ #pragma once +#ifdef __GNUC__ #include +#endif #ifndef _M_AMD64 #if !defined(__ROS_LONG64__) diff --git a/reactos/include/xdk/ntbasedef.h b/reactos/include/xdk/ntbasedef.h index 5fb02c8b197..f41ea8f324d 100644 --- a/reactos/include/xdk/ntbasedef.h +++ b/reactos/include/xdk/ntbasedef.h @@ -121,8 +121,8 @@ #define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT($ULONG) #elif defined(_IA64_) || defined(_ARM_) #define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT($ULONG)) -#else - #error "unknown architecture" +#elif !defined(RC_INVOKED) + #error "Unknown architecture" #endif #if defined(_WIN64) diff --git a/reactos/include/xdk/winnt.template.h b/reactos/include/xdk/winnt.template.h index 8d716719f93..0ffbf219699 100644 --- a/reactos/include/xdk/winnt.template.h +++ b/reactos/include/xdk/winnt.template.h @@ -37,7 +37,9 @@ #include //#include +#ifdef __GNUC__ #include +#endif #include #include