From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1.protonmail.ch (mail1.protonmail.ch [185.70.40.18]) by mx.groups.io with SMTP id smtpd.web11.2904.1580505438059392837 for ; Fri, 31 Jan 2020 13:17:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@protonmail.com header.s=default header.b=B6orMVJY; spf=pass (domain: protonmail.com, ip: 185.70.40.18, mailfrom: vit9696@protonmail.com) Date: Fri, 31 Jan 2020 21:17:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1580505435; bh=s0jhpdfIU3RkaOw7fkqie8pko9+XX2pMBs5Q9VzHMsY=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:Feedback-ID: From; b=B6orMVJY6m8tBYHSXM5n7Wtsh1W/caztJHPyOTr9nPTdNWf2yn6cm017bFY6gX5UX pZzqR8B12Z9D6Tv4uISxuRR/jiL77xWDjorqoGcAaobwBnz1OBWilPbdGWyh4K/MMA 42uTQvlYX36LHapce8BqyGD86vccM1eCXg9NTEq0= To: devel@edk2.groups.io From: "Vitaly Cheptsov" Reply-To: Vitaly Cheptsov Subject: [PATCH 1/1] MdePkg: Use _MSC_VER to determine MSVC compiler Message-ID: <20200131211705.18511-2-vit9696@protonmail.com> In-Reply-To: <20200131211705.18511-1-vit9696@protonmail.com> References: <20200131211705.18511-1-vit9696@protonmail.com> Feedback-ID: p9QuX-L1wMgUm6nrSvNrf8juLupNs0VSnzXGVXuYDxlEahFdWtaedWDMB9zpwGDklGt7kzs1-RBc0cqz327Gcg==:Ext:ProtonMail MIME-Version: 1.0 X-Spam-Status: No, score=-0.7 required=7.0 tests=ALL_TRUSTED,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.protonmail.ch X-Groupsio-MsgNum: 53624 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="---------------------e927bb97250379923488b699334f9dc1"; charset=UTF-8 -----------------------e927bb97250379923488b699334f9dc1 Content-Transfer-Encoding: quoted-printable Date: Sat, 1 Feb 2020 00:17:05 +0300 From: Vitaly Cheptsov In-Reply-To: <20200131211705.18511-1-vit9696@protonmail.com> Message-Id: <20200131211705.18511-2-vit9696@protonmail.com> Mime-Version: 1.0 References: <20200131211705.18511-1-vit9696@protonmail.com> Subject: [PATCH 1/1] MdePkg: Use _MSC_VER to determine MSVC compiler To: devel@edk2.groups.io X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2397 CLANGPDB toolchain, implemented by clang compiler, will also define currently used _MSC_EXTENSIONS macro, which does not behave correctly in many situations as explained in the report. Signed-off-by: Vitaly Cheptsov --- MdePkg/Include/AArch64/ProcessorBind.h | 2 +- MdePkg/Include/Arm/ProcessorBind.h | 8 ++++---- MdePkg/Include/Base.h | 10 +++++----- MdePkg/Include/Ia32/ProcessorBind.h | 6 +++--- MdePkg/Include/X64/ProcessorBind.h | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/MdePkg/Include/AArch64/ProcessorBind.h b/MdePkg/Include/AArch6= 4/ProcessorBind.h index 896bf273ac..fe6b28ec9c 100644 --- a/MdePkg/Include/AArch64/ProcessorBind.h +++ b/MdePkg/Include/AArch64/ProcessorBind.h @@ -24,7 +24,7 @@ #pragma pack() #endif =20 -#if defined(_MSC_EXTENSIONS) +#if defined(_MSC_VER) =20 // // Disable some level 4 compilation warnings (same as IA32 and X64) diff --git a/MdePkg/Include/Arm/ProcessorBind.h b/MdePkg/Include/Arm/Proces= sorBind.h index 1264b44b46..f5a5969d4a 100644 --- a/MdePkg/Include/Arm/ProcessorBind.h +++ b/MdePkg/Include/Arm/ProcessorBind.h @@ -22,7 +22,7 @@ #pragma pack() #endif =20 -#if defined(_MSC_EXTENSIONS) +#if defined(_MSC_VER) =20 // // Disable some level 4 compilation warnings (same as IA32 and X64) @@ -74,11 +74,11 @@ // // RVCT and MSFT don't support the __builtin_unreachable() macro // -#if defined(__ARMCC_VERSION) || defined(_MSC_EXTENSIONS) +#if defined(__ARMCC_VERSION) || defined(_MSC_VER) #define UNREACHABLE() #endif =20 -#if defined(_MSC_EXTENSIONS) +#if defined(_MSC_VER) // // use Microsoft* C compiler dependent integer width types // @@ -212,7 +212,7 @@ typedef INT32 INTN; #define GCC_ASM_IMPORT(name) =20 #endif -#elif defined(_MSC_EXTENSIONS) +#elif defined(_MSC_VER) // // PRESERVE8 is not supported by the MSFT assembler. // diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 321d729c04..bda630a2dc 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -21,7 +21,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // #include =20 -#if defined(_MSC_EXTENSIONS) +#if defined(_MSC_VER) // // Disable warning when last field of data structure is a zero sized array= . // @@ -33,7 +33,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // if the /OPT:REF linker option is used. We defined a macro as this is a // a non standard extension // -#if defined(_MSC_EXTENSIONS) && _MSC_VER < 1800 && !defined (MDE_CPU_EBC) +#if defined(_MSC_VER) && _MSC_VER < 1800 && !defined (MDE_CPU_EBC) /// /// Remove global variable from the linked image if there are no referen= ces to /// it after all compiler and linker optimizations have been performed. @@ -92,7 +92,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent /// flagged with this attribute. /// #define NORETURN __attribute__((noreturn)) - #elif defined(_MSC_EXTENSIONS) && !defined(MDE_CPU_EBC) + #elif defined(_MSC_VER) && !defined(MDE_CPU_EBC) /// /// Signal compilers and analyzers that the function cannot return. /// It is up to the compiler to remove any code past a call to functio= ns @@ -799,7 +799,7 @@ typedef UINTN *BASE_LIST; **/ #ifdef MDE_CPU_EBC #define STATIC_ASSERT(Expression, Message) -#elif defined(_MSC_EXTENSIONS) +#elif defined(_MSC_VER) #define STATIC_ASSERT static_assert #else #define STATIC_ASSERT _Static_assert @@ -1256,7 +1256,7 @@ typedef UINTN RETURN_STATUS; #define SIGNATURE_64(A, B, C, D, E, F, G, H) \ (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << = 32)) =20 -#if defined(_MSC_EXTENSIONS) && !defined (__INTEL_COMPILER) && !defined (M= DE_CPU_EBC) +#if defined(_MSC_VER) && !defined (__INTEL_COMPILER) && !defined (MDE_CPU_= EBC) void * _ReturnAddress(void); #pragma intrinsic(_ReturnAddress) /** diff --git a/MdePkg/Include/Ia32/ProcessorBind.h b/MdePkg/Include/Ia32/Proc= essorBind.h index fa4b7e8e98..bf6a8b09f5 100644 --- a/MdePkg/Include/Ia32/ProcessorBind.h +++ b/MdePkg/Include/Ia32/ProcessorBind.h @@ -49,7 +49,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #endif =20 =20 -#if defined(_MSC_EXTENSIONS) +#if defined(_MSC_VER) =20 // // Disable warning that make it impossible to compile at /W4 @@ -110,7 +110,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #endif =20 =20 -#if defined(_MSC_EXTENSIONS) +#if defined(_MSC_VER) =20 // // use Microsoft C compiler dependent integer width types @@ -276,7 +276,7 @@ typedef INT32 INTN; /// /// If EFIAPI is already defined, then we use that definition. /// -#elif defined(_MSC_EXTENSIONS) +#elif defined(_MSC_VER) /// /// Microsoft* compiler specific method for EFIAPI calling convention. /// diff --git a/MdePkg/Include/X64/ProcessorBind.h b/MdePkg/Include/X64/Proces= sorBind.h index 387e9c5c9c..2e8ac6c8d5 100644 --- a/MdePkg/Include/X64/ProcessorBind.h +++ b/MdePkg/Include/X64/ProcessorBind.h @@ -63,7 +63,7 @@ #endif =20 =20 -#if defined(_MSC_EXTENSIONS) +#if defined(_MSC_VER) =20 // // Disable warning that make it impossible to compile at /W4 @@ -124,7 +124,7 @@ #endif =20 =20 -#if defined(_MSC_EXTENSIONS) +#if defined(_MSC_VER) // // use Microsoft C compiler dependent integer width types // @@ -290,7 +290,7 @@ typedef INT64 INTN; /// /// If EFIAPI is already defined, then we use that definition. /// -#elif defined(_MSC_EXTENSIONS) +#elif defined(_MSC_VER) /// /// Microsoft* compiler specific method for EFIAPI calling convention. /// --=20 2.21.1 (Apple Git-122.3) -----------------------e927bb97250379923488b699334f9dc1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: ProtonMail wsBmBAEBCAAQBQJeNJlZCRBPsoxt7Hy0xQAKCRBPsoxt7Hy0xYnaB/9c37Uo j6MJOEwiwqql+azwhY9Fpq32qXUne+F8tLG8nuXOFF0ULSG6fsv6kHweUoQN CGunS/EvRQnVwRfjBhr+bXEIaEYgHBuH7xgN5I20aPBf/uagdwQrovbSuYrn 68KoAi8gaAGZQA86FGlWgQvHGrQsfufhQIHYa5NFGHMFTTz4oh5s0Z0k/Pse Jgu2SJ8uB2diWNo/N5e863c21+R8x1CiXsSeunz7RXe3l+Ylev8luX8laM0+ Dpo7fJuz8stJhk57oAsBT+U+H43lGQdFsd1oFpCESe6h4awiuK7ACoyLWtd2 S8+JZklX7308G0PvedHiibDUhMlv11XJPTwc =47GQ -----END PGP SIGNATURE----- -----------------------e927bb97250379923488b699334f9dc1--