From nobody Sun Apr 28 22:56:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+53624+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+53624+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1580505441000930.3044564164829; Fri, 31 Jan 2020 13:17:21 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id HcZ2YY1788612xPBTuT7qUgA; Fri, 31 Jan 2020 13:17:19 -0800 X-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 Date: Fri, 31 Jan 2020 21:17:14 +0000 To: devel@edk2.groups.io From: "Vitaly Cheptsov via Groups.Io" Reply-To: devel@edk2.groups.io,vit9696@protonmail.com Subject: [edk2-devel] [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 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io X-Gm-Message-State: DE8jSnQcIK1tkaBxFUhfHm9ox1787277AA= Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha256; boundary="---------------------e927bb97250379923488b699334f9dc1"; charset=UTF-8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1580505439; bh=A5sY+t4HV2y9NRIx3PwMbqWca6d5cmxxXvppmhnfBNw=; h=Content-Type:Date:From:Reply-To:Subject:To; b=Q5eho1PDOGH51Vs42LPZW9fBgBVefAyqktHWPpRZqhUxovSUdxg/Xbp6fTq7clk39T4 d+0qg04aR6AM0G4kpVq5HLaL6tClGjZWWlGHNzf0dCP7x/ZGKebvIh25CnoZzsEv7XFmN MZmh0s9wigjtjVabr+cYjuKi7wEukouplNo= X-Zoho-Virus-Status: 1 X-ZohoMail-DKIM: pass (identity @groups.io) -----------------------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) Content-Type: text/plain; charset="utf-8" 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) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#53624): https://edk2.groups.io/g/devel/message/53624 Mute This Topic: https://groups.io/mt/70882955/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- -----------------------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--