From aaff11172a0cf7f385591e62a535e64f5848c296 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 29 May 2014 23:43:19 +0000 Subject: [PATCH] [INCLUDE] - rewrite msvctarget.h to define all native MSVC architecture macros and do not define x86 sub-architecture numbers, they are deprecated - basetsd.h: Fix header guard, include msvctarget.h instead of adding some custom defines, add missing FIRMWARE_PTR definition, fix POINTER_64 definition svn path=/trunk/; revision=63499 --- reactos/include/psdk/basetsd.h | 42 ++++++---------- reactos/include/psdk/ras.h | 4 +- reactos/include/psdk/winnls.h | 2 +- reactos/include/reactos/idl/ms-dtyp.idl | 12 ++--- reactos/include/reactos/msvctarget.h | 65 +++++++++++++++++++------ 5 files changed, 72 insertions(+), 53 deletions(-) diff --git a/reactos/include/psdk/basetsd.h b/reactos/include/psdk/basetsd.h index 9bafa25e4e3..1dd0c7f5fc5 100644 --- a/reactos/include/psdk/basetsd.h +++ b/reactos/include/psdk/basetsd.h @@ -1,5 +1,8 @@ -#ifndef _BASETSD_H -#define _BASETSD_H +#ifndef _BASETSD_H_ +#define _BASETSD_H_ +#pragma once + +#include #ifndef _M_AMD64 #if !defined(__ROS_LONG64__) @@ -23,30 +26,7 @@ #error Not supported. #endif -#if !defined(_X86_) && !defined(_AMD64_) && !defined(_IA64_) && !defined(_ALPHA_) && \ - !defined(_ARM_) && !defined(_PPC_) && !defined(_MIPS_) && !defined(_68K_) - -#if defined(_M_AMD64) || defined(__x86_64__) -#define _AMD64_ -#elif defined(_M_IX86) || defined(__i386__) -#define _X86_ -#elif defined(_M_IA64) || defined(__ia64__) -#define _IA64_ -#elif defined(_M_ALPHA) || defined(__alpha__) -#define _ALPHA_ -#elif defined(_M_ARM) || defined(__arm__) -#define _ARM_ -#elif defined(_M_PPC) || defined(__powerpc__) -#define _PPC_ -#elif defined(_M_MRX000) || defined(__mips__) -#define _MIPS_ -#elif defined(_M_M68K) || defined(__68k__) -#define _68K_ -#endif - -#endif - -#if !defined(MIDL_PASS) && !defined(RC_INVOKED) +#if defined(_MSC_VER) && !defined(MIDL_PASS) && !defined(RC_INVOKED) #define POINTER_64 __ptr64 #if defined(_WIN64) #define POINTER_32 __ptr32 @@ -56,7 +36,7 @@ #else #define POINTER_64 #define POINTER_32 -#endif /* !defined(MIDL_PASS) && !defined(RC_INVOKED) */ +#endif /* defined(_MSC_VER) && !defined(MIDL_PASS) && !defined(RC_INVOKED) */ #if defined(_M_MRX000) || defined(_M_AMD64) || defined(_M_IA64) typedef unsigned __int64 POINTER_64_INT; @@ -64,6 +44,12 @@ typedef unsigned long POINTER_64_INT; #endif +#if defined(_IA64_) || defined(_AMD64_) + #define FIRMWARE_PTR +#else + #define FIRMWARE_PTR POINTER_32 +#endif + #if 0 /* Not supported yet */ #define POINTER_SIGNED __sptr #define POINTER_UNSIGNED __uptr @@ -214,4 +200,4 @@ typedef KAFFINITY *PKAFFINITY; #endif #endif /* !RC_INVOKED */ -#endif /* _BASETSD_H */ +#endif /* _BASETSD_H_ */ diff --git a/reactos/include/psdk/ras.h b/reactos/include/psdk/ras.h index a0bc80d63e8..aa070afb5da 100644 --- a/reactos/include/psdk/ras.h +++ b/reactos/include/psdk/ras.h @@ -13,7 +13,7 @@ extern "C" /* TODO include from winnt.h so that this typedef is not necessary */ -#ifndef _BASETSD_H +#ifndef _BASETSD_H_ typedef unsigned long ULONG_PTR, *PULONG_PTR; #endif @@ -787,7 +787,7 @@ typedef struct tagRASCOMMSETTINGS typedef DWORD (WINAPI *PFNRASSETCOMMSETTINGS) (HANDLE hPort,RASCOMMSETTINGS *pRasCommSettings,PVOID pvReserved); typedef struct tagRASCUSTOMSCRIPTEXTENSIONS { - DWORD dwSize; + DWORD dwSize; PFNRASSETCOMMSETTINGS pfnRasSetCommSettings; } RASCUSTOMSCRIPTEXTENSIONS; #endif /*(WINVER >= 0x501)*/ diff --git a/reactos/include/psdk/winnls.h b/reactos/include/psdk/winnls.h index 7a9eb2b13a7..8e561b1be24 100644 --- a/reactos/include/psdk/winnls.h +++ b/reactos/include/psdk/winnls.h @@ -473,7 +473,7 @@ static const WCHAR LOCALE_NAME_SYSTEM_DEFAULT[] = {'!','s','y','s','-','d','e',' #define VS_ALLOW_LATIN 0x1 #define GSS_ALLOW_INHERITED_COMMON 0x1 #endif -#ifndef _BASETSD_H +#ifndef _BASETSD_H_ typedef long LONG_PTR; #endif diff --git a/reactos/include/reactos/idl/ms-dtyp.idl b/reactos/include/reactos/idl/ms-dtyp.idl index 592d9dabb48..301da1a4e2f 100644 --- a/reactos/include/reactos/idl/ms-dtyp.idl +++ b/reactos/include/reactos/idl/ms-dtyp.idl @@ -7,7 +7,7 @@ typedef int BOOL, *PBOOL, *LPBOOL; typedef unsigned char BYTE, *PBYTE, *LPBYTE; typedef unsigned long DWORD, *PDWORD, *LPDWORD; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef unsigned int DWORD32; typedef unsigned __int64 DWORD64; cpp_quote("#endif") @@ -15,13 +15,13 @@ cpp_quote("#endif") cpp_quote("#ifndef _WINDEF_H") typedef int INT, *LPINT; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef signed char INT8; typedef signed short INT16; typedef signed int INT32; typedef signed __int64 INT64; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef signed int LONG32; typedef signed __int64 LONG64; cpp_quote("#endif") @@ -37,7 +37,7 @@ cpp_quote("#endif") cpp_quote("#ifndef _WINDEF_H") typedef unsigned int UINT; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef unsigned char UINT8; typedef unsigned short UINT16; typedef unsigned int UINT32; @@ -46,7 +46,7 @@ cpp_quote("#endif") cpp_quote("#ifndef _WINNT_") typedef unsigned long ULONG, *PULONG; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") typedef unsigned int ULONG32; typedef unsigned __int64 ULONG64; cpp_quote("#endif") @@ -77,7 +77,7 @@ cpp_quote("#endif") cpp_quote("#ifndef _WINNT_") typedef BYTE BOOLEAN, *PBOOLEAN; cpp_quote("#endif") -cpp_quote("#ifndef _BASETSD_H") +cpp_quote("#ifndef _BASETSD_H_") #ifdef _WIN64 typedef __int64 LONG_PTR; typedef unsigned __int64 ULONG_PTR; diff --git a/reactos/include/reactos/msvctarget.h b/reactos/include/reactos/msvctarget.h index 9514d907455..6b2241f3016 100644 --- a/reactos/include/reactos/msvctarget.h +++ b/reactos/include/reactos/msvctarget.h @@ -1,19 +1,52 @@ -#ifndef _MSC_VER -#ifndef __GNUC__ -#error Unsupported compiler -#endif + +#pragma once /* translate GCC target defines to MS equivalents. */ -#if defined(__i686__) && !defined(_M_IX86) -#define _M_IX86 600 -#undef __i686__ -#elif defined(__i586__) && !defined(_M_IX86) -#define _M_IX86 500 -#undef __i586__ -#elif defined(__i486__) && !defined(_M_IX86) -#define _M_IX86 400 -#undef __i486__ -#elif defined(__i386__) && !defined(_M_IX86) -#define _M_IX86 300 -#endif +#if defined(__i386__) + #if !defined(_X86_) + #define _X86_ 1 + #endif + #if !defined(_M_IX86) + #define _M_IX86 1 + #endif +#elif defined(__x86_64__) || defined(__x86_64) + #if !defined(_AMD64_) + #define _AMD64_ 1 + #endif + #if !defined(_M_AMD64) + #define _M_AMD64 1 + #endif + #if !defined(_M_X64) + #define _M_X64 1 + #endif +#elif defined(__arm__) + #if !defined(_ARM_) + #define _ARM_ 1 + #endif + #if !defined(_M_ARM) + #define _M_ARM 1 + #endif +#elif defined(__ia64__) + #if !defined(_IA64_) + #define _IA64_ 1 + #endif + #if !defined(_M_IA64) + #define _M_IA64 1 + #endif +#elif defined(__alpha__) + #if !defined(_ALPHA_) + #define _ALPHA_ 1 + #endif + #if !defined(_M_ALPHA) + #define _M_ALPHA 1 + #endif +#elif defined(__powerpc__) + #if !defined(_PPC_) + #define _PPC_ 1 + #endif + #if !defined(_M_PPC) + #define _M_PPC 1 + #endif +#else +#error Unknown architecture #endif