From 733b88bb60a3f8ebe8a43a74b4286ddfb9d97cbc Mon Sep 17 00:00:00 2001 From: Greg Turner Date: Thu, 31 Oct 2002 22:04:33 +0000 Subject: [PATCH] - Cast NDR_* #defines to (unsigned long) instead of (UINT32) like MS headers. - Create __RPC_MAC__ and __RPC_WIN64__ conditional #defines. - Correct NDR_LOCAL_DATA_REPRESENTATION for Mac's. - New NDR_LOCAL_IS_BIG_ENDIAN conditional #define. - #define TARGET_IS_NT50_OR_LATER. --- include/rpc.h | 8 ++++++- include/rpcndr.h | 62 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 61 insertions(+), 9 deletions(-) diff --git a/include/rpc.h b/include/rpc.h index b79ada6cd36..60d1b05f4c0 100644 --- a/include/rpc.h +++ b/include/rpc.h @@ -25,7 +25,13 @@ #ifndef __WINE_RPC_H #define __WINE_RPC_H -#define __RPC_WIN32__ +#if defined(__PPC__) || defined(_MAC) /* ? */ + #define __RPC_MAC__ +#elif defined(_WIN64) + #define __RPC_WIN64__ +#else + #define __RPC_WIN32__ +#endif #define __RPC_FAR #define __RPC_API WINAPI diff --git a/include/rpcndr.h b/include/rpcndr.h index 77600ae62df..560ac4c4a76 100644 --- a/include/rpcndr.h +++ b/include/rpcndr.h @@ -24,18 +24,64 @@ #ifndef __WINE_RPCNDR_H #define __WINE_RPCNDR_H +#include "basetsd.h" #include "rpc.h" -#define NDR_LITTLE_ENDIAN ((UINT32) 0x00000010) -#define NDR_BIG_ENDIAN ((UINT32) 0x00000000) +/* stupid #if can't handle casts... this __stupidity + is just a workaround for that limitation */ -/* Character Representation: ASCII - * Integer Representation: Little Endian - * FP Representation: IEEE - */ -#define NDR_LOCAL_DATA_REPRESENTATION ((UINT32) 0x00000010) -#define NDR_LOCAL_ENDIAN NDR_LITTLE_ENDIAN +#define __NDR_CHAR_REP_MASK 0x000fL +#define __NDR_INT_REP_MASK 0x00f0L +#define __NDR_FLOAT_REP_MASK 0xff00L +#define __NDR_IEEE_FLOAT 0x0000L +#define __NDR_VAX_FLOAT 0x0100L +#define __NDR_IBM_FLOAT 0x0300L + +#define __NDR_ASCII_CHAR 0x0000L +#define __NDR_EBCDIC_CHAR 0x0001L + +#define __NDR_LITTLE_ENDIAN 0x0010L +#define __NDR_BIG_ENDIAN 0x0000L + +/* Mac's are special */ +#if defined(__RPC_MAC__) + #define __NDR_LOCAL_DATA_REPRESENTATION \ + (__NDR_IEEE_FLOAT | __NDR_ASCII_CHAR | __NDR_BIG_ENDIAN) +#else + #define __NDR_LOCAL_DATA_REPRESENTATION \ + (__NDR_IEEE_FLOAT | __NDR_ASCII_CHAR | __NDR_LITTLE_ENDIAN) +#endif + +#define __NDR_LOCAL_ENDIAN \ + (__NDR_LOCAL_DATA_REPRESENTATION & __NDR_INT_REP_MASK) + +/* for convenience, define NDR_LOCAL_IS_BIG_ENDIAN iff it is */ +#if __NDR_LOCAL_ENDIAN == __NDR_BIG_ENDIAN + #define NDR_LOCAL_IS_BIG_ENDIAN +#elif __NDR_LOCAL_ENDIAN == __NDR_LITTLE_ENDIAN + #undef NDR_LOCAL_IS_BIG_ENDIAN +#else + #error alien NDR_LOCAL_ENDIAN - Greg botched the defines again, please report +#endif + +/* finally, do the casts like Microsoft */ + +#define NDR_CHAR_REP_MASK ((unsigned long) __NDR_CHAR_REP_MASK) +#define NDR_INT_REP_MASK ((unsigned long) __NDR_INT_REP_MASK) +#define NDR_FLOAT_REP_MASK ((unsigned long) __NDR_FLOAT_REP_MASK) +#define NDR_IEEE_FLOAT ((unsigned long) __NDR_IEEE_FLOAT) +#define NDR_VAX_FLOAT ((unsigned long) __NDR_VAX_FLOAT) +#define NDR_IBM_FLOAT ((unsigned long) __NDR_IBM_FLOAT) +#define NDR_ASCII_CHAR ((unsigned long) __NDR_ASCII_CHAR) +#define NDR_EBCDIC_CHAR ((unsigned long) __NDR_EBCDIC_CHAR) +#define NDR_LITTLE_ENDIAN ((unsigned long) __NDR_LITTLE_ENDIAN) +#define NDR_BIG_ENDIAN ((unsigned long) __NDR_BIG_ENDIAN) +#define NDR_LOCAL_DATA_REPRESENTATION ((unsigned long) __NDR_LOCAL_DATA_REPRESENTATION) +#define NDR_LOCAL_ENDIAN ((unsigned long) __NDR_LOCAL_ENDIAN) + + +#define TARGET_IS_NT50_OR_LATER 1 #define TARGET_IS_NT40_OR_LATER 1 #define TARGET_IS_NT351_OR_WIN95_OR_LATER 1