Fix Uniata for msvc:

- Add missing msvc intrinsics to winddk.h
- Don't assume compiler means a specific header set, and don't rely on the default calling convention being stdcall.
- Disable a warning spotted by MSVC -- requesting anyone with understanding of the code to have a look.

svn path=/trunk/; revision=42531
This commit is contained in:
Stefan Ginsberg 2009-08-08 18:27:01 +00:00
parent b7cb2a38aa
commit fa657e7e29
4 changed files with 33 additions and 39 deletions

View file

@ -86,47 +86,21 @@
/* Compiler dependencies */ /* Compiler dependencies */
/***************************************************/ /***************************************************/
/* ReactOS-specific defines */ #define DDKAPI __stdcall
#ifdef DDKAPI #define DDKFASTAPI __fastcall
#define USE_REACTOS_DDK #define DDKCDECLAPI __cdecl
#endif //DDKAPI
/* Are we under GNU C (mingw) ??? */ /* Are we under GNU C (mingw) ??? */
#if __GNUC__ >=3 #ifdef __GNUC__
#define DEF_U64(x) (x##ULL) #define DEF_U64(x) (x##ULL)
#define DEF_I64(x) (x##LL) #define DEF_I64(x) (x##LL)
/* ReactOS-specific defines */
#ifdef USE_REACTOS_DDK
#define DDKFASTAPI __attribute__((fastcall))
#else //USE_REACTOS_DDK
#define DDKAPI __attribute__((stdcall))
#define DDKFASTAPI __attribute__((fastcall))
#define DDKCDECLAPI __attribute__((cdecl))
#endif //DDKAPI
#define DECLSPEC_NAKED __attribute__((naked))
#else // !__GNUC__ => MSVC/Intel #else // !__GNUC__ => MSVC/Intel
#define DEF_U64(x) (x##UI64) #define DEF_U64(x) (x##UI64)
#define DEF_I64(x) (x##I64) #define DEF_I64(x) (x##I64)
/* ReactOS-specific defines */
#ifdef USE_REACTOS_DDK
#else //USE_REACTOS_DDK
#define DDKAPI __stdcall
#define DDKFASTAPI __fastcall
#define DDKCDECLAPI _cdecl
#endif //DDKAPI
#define DECLSPEC_NAKED __declspec(naked)
#endif //__GNUC__ #endif //__GNUC__

View file

@ -425,7 +425,15 @@ UniataAhciSetupFIS(
deviceExtension->lun[ldev].IdentifyData.FeaturesSupport.Address48) { deviceExtension->lun[ldev].IdentifyData.FeaturesSupport.Address48) {
i++; i++;
} else { } else {
#ifdef _MSC_VER
#pragma message ("HACK HACK HACK Disabling warning HACK HACK HACK")
#pragma warning(push)
#pragma warning(disable:4333)
#endif
fis[7] |= (plba[3] >> 24) & 0x0f; fis[7] |= (plba[3] >> 24) & 0x0f;
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} }
fis[8] = plba[3]; fis[8] = plba[3];

View file

@ -629,12 +629,14 @@ typedef struct _IMAGE_EXPORT_DIRECTORY {
NTHALAPI NTHALAPI
VOID VOID
NTAPI
HalDisplayString ( HalDisplayString (
PUCHAR String PUCHAR String
); );
NTHALAPI NTHALAPI
VOID VOID
NTAPI
HalQueryDisplayParameters ( HalQueryDisplayParameters (
OUT PULONG WidthInCharacters, OUT PULONG WidthInCharacters,
OUT PULONG HeightInLines, OUT PULONG HeightInLines,
@ -644,6 +646,7 @@ HalQueryDisplayParameters (
NTHALAPI NTHALAPI
VOID VOID
NTAPI
HalSetDisplayParameters ( HalSetDisplayParameters (
IN ULONG CursorColumn, IN ULONG CursorColumn,
IN ULONG CursorRow IN ULONG CursorRow

View file

@ -35,6 +35,24 @@ extern "C" {
#include "intrin.h" #include "intrin.h"
#endif #endif
#ifdef _MSC_VER
//
// FIXME: MSVC Intrinsics
//
unsigned char __readfsbyte(const unsigned long Offset);
#pragma intrinsic(__readfsbyte)
long _InterlockedExchange(volatile long * const Target, const long Value);
#pragma intrinsic(_InterlockedExchange)
long _InterlockedExchangeAdd(volatile long * const Addend, const long Value);
#pragma intrinsic(_InterlockedExchangeAdd)
long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand);
#pragma intrinsic(_InterlockedCompareExchange)
long _InterlockedDecrement(volatile long * const lpAddend);
#pragma intrinsic(_InterlockedDecrement)
long _InterlockedIncrement(volatile long * const lpAddend);
#pragma intrinsic(_InterlockedIncrement)
#endif
#if !defined(_NTHAL_) #if !defined(_NTHAL_)
#define NTHALAPI DECLSPEC_IMPORT #define NTHALAPI DECLSPEC_IMPORT
#else #else
@ -5116,15 +5134,6 @@ typedef struct _KFLOATING_SAVE {
ULONG Spare1; ULONG Spare1;
} KFLOATING_SAVE, *PKFLOATING_SAVE; } KFLOATING_SAVE, *PKFLOATING_SAVE;
#ifdef _MSC_VER
//
// FIXME: Intrinsics
//
unsigned char __readfsbyte(const unsigned long Offset);
#pragma intrinsic(__readfsbyte)
#endif
FORCEINLINE FORCEINLINE
ULONG ULONG
KeGetCurrentProcessorNumber(VOID) KeGetCurrentProcessorNumber(VOID)