From 395e8bafc4450137b8f3b1bfac4c71c00ad1bbfa Mon Sep 17 00:00:00 2001 From: Patrik Stridvall Date: Tue, 5 Feb 2002 18:09:29 +0000 Subject: [PATCH] MSVC compile fixes. --- dlls/shlwapi/ordinal.c | 6 +++--- include/basetsd.h | 23 +++++++++++++++-------- include/ntddk.h | 2 +- include/oleauto.h | 8 ++++---- include/poppack.h | 6 +++--- include/pshpack1.h | 6 +++++- include/pshpack2.h | 6 +++++- include/pshpack4.h | 6 +++++- include/pshpack8.h | 6 +++++- include/rpcdce.h | 3 +-- include/rpcndr.h | 20 ++++++++++---------- 11 files changed, 57 insertions(+), 35 deletions(-) diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 28e2e0a591b..537c2533793 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -325,7 +325,7 @@ HSHARED WINAPI SHLWAPI_7 (DWORD dwProcId, LPCVOID lpvData, DWORD dwSize) /* Write size of data, followed by the data, to the view */ *((DWORD*)pMapped) = dwSize; if (dwSize) - memcpy(pMapped + sizeof(dwSize), lpvData, dwSize); + memcpy((char *) pMapped + sizeof(dwSize), lpvData, dwSize); /* Release view. All further views mapped will be opaque */ UnmapViewOfFile(pMapped); @@ -369,7 +369,7 @@ PVOID WINAPI SHLWAPI_8 (HSHARED hShared, DWORD dwProcId) CloseHandle(hDup); if (pMapped) - return pMapped + sizeof(DWORD); /* Hide size */ + return (char *) pMapped + sizeof(DWORD); /* Hide size */ return NULL; } @@ -391,7 +391,7 @@ PVOID WINAPI SHLWAPI_8 (HSHARED hShared, DWORD dwProcId) BOOL WINAPI SHLWAPI_9 (LPVOID lpView) { TRACE("(%p)\n", lpView); - return UnmapViewOfFile(lpView - sizeof(DWORD)); /* Include size */ + return UnmapViewOfFile((char *) lpView - sizeof(DWORD)); /* Include size */ } /************************************************************************* diff --git a/include/basetsd.h b/include/basetsd.h index fcee7dfcfc6..51f15f4a493 100644 --- a/include/basetsd.h +++ b/include/basetsd.h @@ -24,17 +24,22 @@ extern "C" { /* Type model indepent typedefs */ -typedef char __int8; -typedef unsigned char __uint8; +#ifndef _MSC_VER +typedef char __int8; +typedef short __int16; +typedef int __int32; +typedef long long __int64; +#endif /* !defined(_MSC_VER) */ -typedef short __int16; -typedef unsigned short __uint16; +typedef unsigned char __uint8; +typedef unsigned short __uint16; +typedef unsigned int __uint32; -typedef int __int32; -typedef unsigned int __uint32; - -typedef long long __int64; +#ifndef _MSC_VER typedef unsigned long long __uint64; +#else +typedef unsigned __int64 __uint64; +#endif /* !defined(_MSC_VER) */ #if defined(_WIN64) @@ -44,7 +49,9 @@ typedef void *__ptr64; #else /* FIXME: defined(_WIN32) */ typedef void *__ptr32; +#ifndef _MSC_VER typedef __uint64 __ptr64; +#endif /* !defined(_MSC_VER) */ #endif diff --git a/include/ntddk.h b/include/ntddk.h index 0b047490ca0..66228ef4b82 100644 --- a/include/ntddk.h +++ b/include/ntddk.h @@ -29,7 +29,7 @@ typedef struct _IO_STATUS_BLOCK ULONG_PTR Information; } IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; -typedef VOID NTAPI (*PIO_APC_ROUTINE) ( PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved ); +typedef VOID (NTAPI *PIO_APC_ROUTINE) ( PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved ); /* registry diff --git a/include/oleauto.h b/include/oleauto.h index 5fa9e9b39ef..672aedb085a 100644 --- a/include/oleauto.h +++ b/include/oleauto.h @@ -51,8 +51,8 @@ SafeArrayAllocDescriptor(UINT cDims, struct tagSAFEARRAY **ppsaOut); HRESULT WINAPI SafeArrayAllocData(struct tagSAFEARRAY *psa); -struct tagSAFEARRAY WINAPI -*SafeArrayCreate(VARTYPE vt, UINT cDims, struct tagSAFEARRAYBOUND *rgsabound); +struct tagSAFEARRAY * WINAPI +SafeArrayCreate(VARTYPE vt, UINT cDims, struct tagSAFEARRAYBOUND *rgsabound); HRESULT WINAPI SafeArrayDestroyDescriptor(struct tagSAFEARRAY *psa); @@ -102,8 +102,8 @@ SafeArrayDestroy(struct tagSAFEARRAY *psa); HRESULT WINAPI SafeArrayCopy(struct tagSAFEARRAY *psa, struct tagSAFEARRAY **ppsaOut); -struct tagSAFEARRAY WINAPI -*SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements); +struct tagSAFEARRAY * WINAPI +SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements); HRESULT WINAPI SafeArrayRedim(struct tagSAFEARRAY *psa, struct tagSAFEARRAYBOUND *psaboundNew); diff --git a/include/poppack.h b/include/poppack.h index 67c278f0c1d..50dc5b51b9d 100644 --- a/include/poppack.h +++ b/include/poppack.h @@ -4,7 +4,7 @@ # endif /* Depth == 3 */ -# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) # if __WINE_PSHPACK_H2 == 1 # pragma pack(1) # elif __WINE_PSHPACK_H2 == 2 @@ -24,7 +24,7 @@ # endif /* Depth == 2 */ -# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) # if __WINE_PSHPACK_H == 1 # pragma pack(1) # elif __WINE_PSHPACK_H == 2 @@ -44,7 +44,7 @@ # endif /* Depth == 1 */ -# if defined(__GNUC__) || defined(__SUNPRO_C) +# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(_MSC_VER) # pragma pack() # elif defined(__SUNPRO_CC) # warning "Assuming a default alignment of 4" diff --git a/include/pshpack1.h b/include/pshpack1.h index 1771c72b528..a2947087104 100644 --- a/include/pshpack1.h +++ b/include/pshpack1.h @@ -20,7 +20,11 @@ # include "poppack.h" # endif -# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if _MSC_VER >= 800 +# pragma warning(disable:4103) +# endif + +# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) # pragma pack(1) # elif !defined(RC_INVOKED) # error "Adjusting the alignment is not supported with this compiler" diff --git a/include/pshpack2.h b/include/pshpack2.h index 603e581367b..acc9798da01 100644 --- a/include/pshpack2.h +++ b/include/pshpack2.h @@ -20,7 +20,11 @@ # include "poppack.h" # endif -# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if _MSC_VER >= 800 +# pragma warning(disable:4103) +# endif + +# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) # pragma pack(2) # elif !defined(RC_INVOKED) # error "Adjusting the alignment is not supported with this compiler" diff --git a/include/pshpack4.h b/include/pshpack4.h index eb0a805b3c5..336c77ccbe3 100644 --- a/include/pshpack4.h +++ b/include/pshpack4.h @@ -20,7 +20,11 @@ # include "poppack.h" # endif -# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if _MSC_VER >= 800 +# pragma warning(disable:4103) +# endif + +# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) # pragma pack(4) # elif !defined(RC_INVOKED) # error "Adjusting the alignment is not supported with this compiler" diff --git a/include/pshpack8.h b/include/pshpack8.h index f2ef88c86ec..5d12ba33ec8 100644 --- a/include/pshpack8.h +++ b/include/pshpack8.h @@ -20,7 +20,11 @@ # include "poppack.h" # endif -# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# if _MSC_VER >= 800 +# pragma warning(disable:4103) +# endif + +# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) || defined(_MSC_VER) # pragma pack(8) # warning "8 as alignment is not supported" # elif !defined(RC_INVOKED) diff --git a/include/rpcdce.h b/include/rpcdce.h index 9b520d3b5e6..f033297f7a5 100644 --- a/include/rpcdce.h +++ b/include/rpcdce.h @@ -63,8 +63,7 @@ typedef struct _RPC_IF_ID typedef RPC_STATUS RPC_ENTRY RPC_IF_CALLBACK_FN( RPC_IF_HANDLE InterfaceUuid, LPVOID Context ); -typedef void __RPC_USER (* RPC_AUTH_KEY_RETRIEVAL_FN)( LPVOID Arg, LPWSTR ServerPrincName, - ULONG KeyVer, LPVOID* Key, RPC_STATUS* status ); +typedef void (__RPC_USER *RPC_AUTH_KEY_RETRIEVAL_FN)(); typedef struct _RPC_POLICY { diff --git a/include/rpcndr.h b/include/rpcndr.h index 20684b0c788..b89c6e05c93 100644 --- a/include/rpcndr.h +++ b/include/rpcndr.h @@ -22,9 +22,9 @@ typedef struct #define NDRSContextValue(hContext) (&(hContext)->userContext) #define cbNDRContext 20 -typedef void __RPC_USER (*NDR_RUNDOWN)(void *context); -typedef void __RPC_USER (*NDR_NOTIFY_ROUTINE)(void); -typedef void __RPC_USER (*NDR_NOTIFY2_ROUTINE)(_wine_boolean flag); +typedef void (__RPC_USER *NDR_RUNDOWN)(void *context); +typedef void (__RPC_USER *NDR_NOTIFY_ROUTINE)(void); +typedef void (__RPC_USER *NDR_NOTIFY2_ROUTINE)(_wine_boolean flag); #define DECLSPEC_UUID(x) #define MIDL_INTERFACE(x) struct @@ -33,7 +33,7 @@ struct _MIDL_STUB_MESSAGE; struct _MIDL_STUB_DESC; struct _FULL_PTR_XLAT_TABLES; -typedef void __RPC_USER (*EXPR_EVAL)(struct _MIDL_STUB_MESSAGE *); +typedef void (__RPC_USER *EXPR_EVAL)(struct _MIDL_STUB_MESSAGE *); typedef const unsigned char *PFORMAT_STRING; typedef struct @@ -73,8 +73,8 @@ typedef struct _MIDL_STUB_MESSAGE ULONG_PTR MaxCount; unsigned long Offset; unsigned long ActualCount; - void * __RPC_API (*pfnAllocate)(size_t); - void __RPC_API (*pfnFree)(void *); + void * (__RPC_API *pfnAllocate)(size_t); + void (__RPC_API *pfnFree)(void *); unsigned char *StackTop; unsigned char *pPresentedType; unsigned char *pTransmitType; @@ -125,8 +125,8 @@ typedef struct _COMM_FAULT_OFFSETS COMM_FAULT_OFFSETS; typedef struct _MIDL_STUB_DESC { void *RpcInterfaceInformation; - void * __RPC_API (*pfnAllocate)(size_t); - void __RPC_API (*pfnFree)(void *); + void * (__RPC_API *pfnAllocate)(size_t); + void (__RPC_API *pfnFree)(void *); union { handle_t *pAutoHandle; handle_t *pPrimitiveHandle; @@ -161,9 +161,9 @@ typedef struct _MIDL_FORMAT_STRING #endif } MIDL_FORMAT_STRING; -typedef void __RPC_API (*STUB_THUNK)( PMIDL_STUB_MESSAGE ); +typedef void (__RPC_API *STUB_THUNK)( PMIDL_STUB_MESSAGE ); -typedef long __RPC_API (*SERVER_ROUTINE)(); +typedef long (__RPC_API *SERVER_ROUTINE)(); typedef struct _MIDL_SERVER_INFO_ {