From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: lersek@redhat.com) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Fri, 16 Aug 2019 12:40:12 -0700 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09A3D307D844; Fri, 16 Aug 2019 19:40:12 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-63.ams2.redhat.com [10.36.116.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 173CF173D9; Fri, 16 Aug 2019 19:40:10 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add STATIC_ASSERT macro To: devel@edk2.groups.io, michael.d.kinney@intel.com, "vit9696@protonmail.com" , "Gao, Liming" References: <20190813081644.53963-1-vit9696@protonmail.com> <20190813081644.53963-2-vit9696@protonmail.com> From: "Laszlo Ersek" Message-ID: <63b006f7-0ff5-3578-25d6-a0216b06c497@redhat.com> Date: Fri, 16 Aug 2019 21:40:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 16 Aug 2019 19:40:12 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 08/15/19 18:08, Michael D Kinney wrote: > Reviewed-by: Michael D Kinney To summarize: personally, I disgree, but I can accept if the patch goes in with Mike's R-b. Thanks, Laszlo >> -----Original Message----- >> From: devel@edk2.groups.io >> [mailto:devel@edk2.groups.io] On Behalf Of vit9696 via >> Groups.Io >> Sent: Tuesday, August 13, 2019 1:17 AM >> To: devel@edk2.groups.io >> Subject: [edk2-devel] [PATCH v2 1/1] MdePkg: Add >> STATIC_ASSERT macro >> >> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2048 >> >> Provide a macro for compile time assertions. >> Equivalent to C11 static_assert macro from assert.h. >> >> Signed-off-by: Vitaly Cheptsov >> --- >> MdePkg/Include/Base.h | 11 +++++++++++ >> 1 file changed, 11 insertions(+) >> >> diff --git a/MdePkg/Include/Base.h >> b/MdePkg/Include/Base.h index >> ce20b5f01dce..f85f7028a262 100644 >> --- a/MdePkg/Include/Base.h >> +++ b/MdePkg/Include/Base.h >> @@ -843,6 +843,17 @@ typedef UINTN *BASE_LIST; >> #define OFFSET_OF(TYPE, Field) ((UINTN) &(((TYPE *)0)- >>> Field)) #endif >> >> +/// >> +/// Portable definition for compile time assertions. >> +/// Equivalent to C11 static_assert macro from >> assert.h. >> +/// Takes condtion and error message as its arguments. >> +/// >> +#ifdef _MSC_EXTENSIONS >> + #define STATIC_ASSERT static_assert >> +#else >> + #define STATIC_ASSERT _Static_assert >> +#endif >> + >> /** >> Macro that returns a pointer to the data structure >> that contains a specified field of >> that data structure. This is a lightweight method >> to hide information by placing a >> -- >> 2.20.1 (Apple Git-117) >> >> >> -=-=-=-=-=-= >> Groups.io Links: You receive all messages sent to this >> group. >> >> View/Reply Online (#45503): >> https://edk2.groups.io/g/devel/message/45503 >> Mute This Topic: https://groups.io/mt/32850582/1643496 >> Group Owner: devel+owner@edk2.groups.io >> Unsubscribe: https://edk2.groups.io/g/devel/unsub >> [michael.d.kinney@intel.com] >> -=-=-=-=-=-= > > > >