From 5bf1fbec4938dd7d5ae46a0595a7595e3486dab2 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 28 Oct 2017 13:52:44 +0100 Subject: [PATCH] [UDFS] Do not take some of the msvc codepaths when compiling with clang-cl due to issues such as inline assembly support. CORE-11799 (#94) --- .../filesystems/udfs/Include/Sys_spec_lib.cpp | 4 ++-- drivers/filesystems/udfs/Include/wcache_lib.cpp | 2 +- drivers/filesystems/udfs/namesup.cpp | 2 +- drivers/filesystems/udfs/udf_info/alloc.cpp | 6 +++--- drivers/filesystems/udfs/udf_info/dirtree.cpp | 4 ++-- drivers/filesystems/udfs/udf_info/extent.cpp | 4 ++-- drivers/filesystems/udfs/udf_info/mount.cpp | 2 +- drivers/filesystems/udfs/udf_info/udf_info.cpp | 16 ++++++++-------- drivers/filesystems/udfs/write.cpp | 6 +++--- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp b/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp index d2602d6f76b..d775e86bd2d 100644 --- a/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp +++ b/drivers/filesystems/udfs/Include/Sys_spec_lib.cpp @@ -806,7 +806,7 @@ MyAppendUnicodeToString_( #define UDF_UNC_STR_TAG "AppStr" #endif -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) __asm push ebx __asm push esi @@ -868,7 +868,7 @@ MyInitUnicodeString( USHORT i; -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) __asm push ebx __asm push esi diff --git a/drivers/filesystems/udfs/Include/wcache_lib.cpp b/drivers/filesystems/udfs/Include/wcache_lib.cpp index db479131132..b00dc50357d 100644 --- a/drivers/filesystems/udfs/Include/wcache_lib.cpp +++ b/drivers/filesystems/udfs/Include/wcache_lib.cpp @@ -455,7 +455,7 @@ WCacheGetSortedListIndex( if(!BlockCount) return 0; -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) __asm push ecx __asm push ebx diff --git a/drivers/filesystems/udfs/namesup.cpp b/drivers/filesystems/udfs/namesup.cpp index a028f283f87..b30ad8bc2aa 100644 --- a/drivers/filesystems/udfs/namesup.cpp +++ b/drivers/filesystems/udfs/namesup.cpp @@ -24,7 +24,7 @@ UDFDissectName( USHORT i; -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) PWCHAR retval; diff --git a/drivers/filesystems/udfs/udf_info/alloc.cpp b/drivers/filesystems/udfs/udf_info/alloc.cpp index 0d55dcfb4bb..49905fb61a6 100644 --- a/drivers/filesystems/udfs/udf_info/alloc.cpp +++ b/drivers/filesystems/udfs/udf_info/alloc.cpp @@ -50,7 +50,7 @@ UDFPhysLbaToPart( ) { PUDFPartMap pm = Vcb->Partitions; -#if defined (_X86_) && defined (_MSC_VER) +#if defined (_X86_) && defined (_MSC_VER) && !defined(__clang__) uint32 retval; __asm { push ebx @@ -1280,7 +1280,7 @@ UDFSetBits__( IN uint32 bc ) { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) __asm { push eax push ebx @@ -1388,7 +1388,7 @@ UDFClrBits__( IN uint32 bc ) { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) __asm { push eax push ebx diff --git a/drivers/filesystems/udfs/udf_info/dirtree.cpp b/drivers/filesystems/udfs/udf_info/dirtree.cpp index 0f425c7032d..d20e3539669 100644 --- a/drivers/filesystems/udfs/udf_info/dirtree.cpp +++ b/drivers/filesystems/udfs/udf_info/dirtree.cpp @@ -242,7 +242,7 @@ UDFDirIndexTrunc( /* This routine returns pointer to DirIndex item with index i. */ -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) __declspec (naked) #endif PDIR_INDEX_ITEM @@ -252,7 +252,7 @@ UDFDirIndex( IN uint32 i // EDX ) { -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) __asm { push ebx push ecx diff --git a/drivers/filesystems/udfs/udf_info/extent.cpp b/drivers/filesystems/udfs/udf_info/extent.cpp index 8c76c2b0188..f949cf1d52a 100644 --- a/drivers/filesystems/udfs/udf_info/extent.cpp +++ b/drivers/filesystems/udfs/udf_info/extent.cpp @@ -146,7 +146,7 @@ UDFGetExtentLength( if(!Extent) return 0; int64 i=0; -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) __asm push ebx __asm push ecx @@ -227,7 +227,7 @@ UDFGetMappingLength( if(!Extent) return 0; uint32 i=0; -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) __asm push ebx __asm mov ebx,Extent diff --git a/drivers/filesystems/udfs/udf_info/mount.cpp b/drivers/filesystems/udfs/udf_info/mount.cpp index 7ce68faa9fe..2cbaccc5064 100644 --- a/drivers/filesystems/udfs/udf_info/mount.cpp +++ b/drivers/filesystems/udfs/udf_info/mount.cpp @@ -2939,7 +2939,7 @@ UDFCheckZeroBuf( ) { -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) BOOLEAN RC = FALSE; diff --git a/drivers/filesystems/udfs/udf_info/udf_info.cpp b/drivers/filesystems/udfs/udf_info/udf_info.cpp index 0d9e5c1bcd5..6f29d88e5f1 100644 --- a/drivers/filesystems/udfs/udf_info/udf_info.cpp +++ b/drivers/filesystems/udfs/udf_info/udf_info.cpp @@ -4280,7 +4280,7 @@ UDFCompareFileInfo( #pragma warning(disable:4035) // re-enable below #endif -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) __declspec (naked) #endif // _X86_ uint32 @@ -4290,7 +4290,7 @@ crc32( IN uint32 len // EDX ) { -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) // uint32 _Size = len; __asm { @@ -4346,7 +4346,7 @@ EO_CRC: The polynomial used is: x^16 + x^12 + x^15 + 1 */ -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) __declspec (naked) #endif // _X86_ uint16 @@ -4356,7 +4356,7 @@ UDFUnicodeCksum( uint32 n // EDX ) { -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) // uint32 _Size = n; __asm { @@ -4412,7 +4412,7 @@ EO_uCRC: #endif // _X86_ } // end UDFUnicodeCksum() -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) __declspec (naked) #endif // _X86_ uint16 @@ -4422,7 +4422,7 @@ UDFUnicodeCksum150( uint32 n // EDX ) { -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) // uint32 _Size = n; __asm { @@ -4517,7 +4517,7 @@ use16_2: The OSTA-UDF(tm) 1.50 standard states that using CRCs is mandatory. The polynomial used is: x^16 + x^12 + x^15 + 1 */ -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) __declspec (naked) #endif // _X86_ uint16 @@ -4527,7 +4527,7 @@ UDFCrc( IN uint32 Size // EDX ) { -#if defined (_X86_) && defined (_MSC_VER) +#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__) // uint32 _Size = Size; __asm { diff --git a/drivers/filesystems/udfs/write.cpp b/drivers/filesystems/udfs/write.cpp index 467e41b6beb..ceaa69bda01 100644 --- a/drivers/filesystems/udfs/write.cpp +++ b/drivers/filesystems/udfs/write.cpp @@ -324,7 +324,7 @@ UDFCommonWrite( // flush system cache UDFFlushLogicalVolume(NULL, NULL, Vcb, 0); } -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) /* FIXME */ if(PagingIo) { CollectStatistics(Vcb, MetaDataWrites); @@ -444,7 +444,7 @@ UDFCommonWrite( TruncatedLength = WriteLength; } -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) /* FIXME */ if(PagingIo) { CollectStatistics(Vcb, UserFileWrites); @@ -906,7 +906,7 @@ UDFCommonWrite( UDFUnlockCallersBuffer(PtrIrpContext, Irp, SystemBuffer); -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(__clang__) /* FIXME */ if(PagingIo) { CollectStatistics(Vcb, UserDiskWrites);