[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
This commit is contained in:
Timo Kreuzer 2014-05-29 23:43:19 +00:00
parent 87026354cb
commit aaff11172a
5 changed files with 72 additions and 53 deletions

View file

@ -1,5 +1,8 @@
#ifndef _BASETSD_H #ifndef _BASETSD_H_
#define _BASETSD_H #define _BASETSD_H_
#pragma once
#include <msvctarget.h>
#ifndef _M_AMD64 #ifndef _M_AMD64
#if !defined(__ROS_LONG64__) #if !defined(__ROS_LONG64__)
@ -23,30 +26,7 @@
#error Not supported. #error Not supported.
#endif #endif
#if !defined(_X86_) && !defined(_AMD64_) && !defined(_IA64_) && !defined(_ALPHA_) && \ #if defined(_MSC_VER) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
!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)
#define POINTER_64 __ptr64 #define POINTER_64 __ptr64
#if defined(_WIN64) #if defined(_WIN64)
#define POINTER_32 __ptr32 #define POINTER_32 __ptr32
@ -56,7 +36,7 @@
#else #else
#define POINTER_64 #define POINTER_64
#define POINTER_32 #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) #if defined(_M_MRX000) || defined(_M_AMD64) || defined(_M_IA64)
typedef unsigned __int64 POINTER_64_INT; typedef unsigned __int64 POINTER_64_INT;
@ -64,6 +44,12 @@
typedef unsigned long POINTER_64_INT; typedef unsigned long POINTER_64_INT;
#endif #endif
#if defined(_IA64_) || defined(_AMD64_)
#define FIRMWARE_PTR
#else
#define FIRMWARE_PTR POINTER_32
#endif
#if 0 /* Not supported yet */ #if 0 /* Not supported yet */
#define POINTER_SIGNED __sptr #define POINTER_SIGNED __sptr
#define POINTER_UNSIGNED __uptr #define POINTER_UNSIGNED __uptr
@ -214,4 +200,4 @@ typedef KAFFINITY *PKAFFINITY;
#endif #endif
#endif /* !RC_INVOKED */ #endif /* !RC_INVOKED */
#endif /* _BASETSD_H */ #endif /* _BASETSD_H_ */

View file

@ -13,7 +13,7 @@ extern "C"
/* TODO /* TODO
include <basetsd.h> from winnt.h so that this typedef is not necessary include <basetsd.h> from winnt.h so that this typedef is not necessary
*/ */
#ifndef _BASETSD_H #ifndef _BASETSD_H_
typedef unsigned long ULONG_PTR, *PULONG_PTR; typedef unsigned long ULONG_PTR, *PULONG_PTR;
#endif #endif
@ -787,7 +787,7 @@ typedef struct tagRASCOMMSETTINGS
typedef DWORD (WINAPI *PFNRASSETCOMMSETTINGS) (HANDLE hPort,RASCOMMSETTINGS *pRasCommSettings,PVOID pvReserved); typedef DWORD (WINAPI *PFNRASSETCOMMSETTINGS) (HANDLE hPort,RASCOMMSETTINGS *pRasCommSettings,PVOID pvReserved);
typedef struct tagRASCUSTOMSCRIPTEXTENSIONS typedef struct tagRASCUSTOMSCRIPTEXTENSIONS
{ {
DWORD dwSize; DWORD dwSize;
PFNRASSETCOMMSETTINGS pfnRasSetCommSettings; PFNRASSETCOMMSETTINGS pfnRasSetCommSettings;
} RASCUSTOMSCRIPTEXTENSIONS; } RASCUSTOMSCRIPTEXTENSIONS;
#endif /*(WINVER >= 0x501)*/ #endif /*(WINVER >= 0x501)*/

View file

@ -473,7 +473,7 @@ static const WCHAR LOCALE_NAME_SYSTEM_DEFAULT[] = {'!','s','y','s','-','d','e','
#define VS_ALLOW_LATIN 0x1 #define VS_ALLOW_LATIN 0x1
#define GSS_ALLOW_INHERITED_COMMON 0x1 #define GSS_ALLOW_INHERITED_COMMON 0x1
#endif #endif
#ifndef _BASETSD_H #ifndef _BASETSD_H_
typedef long LONG_PTR; typedef long LONG_PTR;
#endif #endif

View file

@ -7,7 +7,7 @@ typedef int BOOL, *PBOOL, *LPBOOL;
typedef unsigned char BYTE, *PBYTE, *LPBYTE; typedef unsigned char BYTE, *PBYTE, *LPBYTE;
typedef unsigned long DWORD, *PDWORD, *LPDWORD; typedef unsigned long DWORD, *PDWORD, *LPDWORD;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef unsigned int DWORD32; typedef unsigned int DWORD32;
typedef unsigned __int64 DWORD64; typedef unsigned __int64 DWORD64;
cpp_quote("#endif") cpp_quote("#endif")
@ -15,13 +15,13 @@ cpp_quote("#endif")
cpp_quote("#ifndef _WINDEF_H") cpp_quote("#ifndef _WINDEF_H")
typedef int INT, *LPINT; typedef int INT, *LPINT;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef signed char INT8; typedef signed char INT8;
typedef signed short INT16; typedef signed short INT16;
typedef signed int INT32; typedef signed int INT32;
typedef signed __int64 INT64; typedef signed __int64 INT64;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef signed int LONG32; typedef signed int LONG32;
typedef signed __int64 LONG64; typedef signed __int64 LONG64;
cpp_quote("#endif") cpp_quote("#endif")
@ -37,7 +37,7 @@ cpp_quote("#endif")
cpp_quote("#ifndef _WINDEF_H") cpp_quote("#ifndef _WINDEF_H")
typedef unsigned int UINT; typedef unsigned int UINT;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef unsigned char UINT8; typedef unsigned char UINT8;
typedef unsigned short UINT16; typedef unsigned short UINT16;
typedef unsigned int UINT32; typedef unsigned int UINT32;
@ -46,7 +46,7 @@ cpp_quote("#endif")
cpp_quote("#ifndef _WINNT_") cpp_quote("#ifndef _WINNT_")
typedef unsigned long ULONG, *PULONG; typedef unsigned long ULONG, *PULONG;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
typedef unsigned int ULONG32; typedef unsigned int ULONG32;
typedef unsigned __int64 ULONG64; typedef unsigned __int64 ULONG64;
cpp_quote("#endif") cpp_quote("#endif")
@ -77,7 +77,7 @@ cpp_quote("#endif")
cpp_quote("#ifndef _WINNT_") cpp_quote("#ifndef _WINNT_")
typedef BYTE BOOLEAN, *PBOOLEAN; typedef BYTE BOOLEAN, *PBOOLEAN;
cpp_quote("#endif") cpp_quote("#endif")
cpp_quote("#ifndef _BASETSD_H") cpp_quote("#ifndef _BASETSD_H_")
#ifdef _WIN64 #ifdef _WIN64
typedef __int64 LONG_PTR; typedef __int64 LONG_PTR;
typedef unsigned __int64 ULONG_PTR; typedef unsigned __int64 ULONG_PTR;

View file

@ -1,19 +1,52 @@
#ifndef _MSC_VER
#ifndef __GNUC__ #pragma once
#error Unsupported compiler
#endif
/* translate GCC target defines to MS equivalents. */ /* translate GCC target defines to MS equivalents. */
#if defined(__i686__) && !defined(_M_IX86) #if defined(__i386__)
#define _M_IX86 600 #if !defined(_X86_)
#undef __i686__ #define _X86_ 1
#elif defined(__i586__) && !defined(_M_IX86) #endif
#define _M_IX86 500 #if !defined(_M_IX86)
#undef __i586__ #define _M_IX86 1
#elif defined(__i486__) && !defined(_M_IX86) #endif
#define _M_IX86 400 #elif defined(__x86_64__) || defined(__x86_64)
#undef __i486__ #if !defined(_AMD64_)
#elif defined(__i386__) && !defined(_M_IX86) #define _AMD64_ 1
#define _M_IX86 300 #endif
#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 #endif