From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.120, mailfrom: liming.gao@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Wed, 14 Aug 2019 06:50:31 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 06:50:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,385,1559545200"; d="scan'208";a="179056828" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga003.jf.intel.com with ESMTP; 14 Aug 2019 06:50:30 -0700 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 14 Aug 2019 06:50:30 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 14 Aug 2019 06:50:30 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by shsmsx102.ccr.corp.intel.com ([169.254.2.19]) with mapi id 14.03.0439.000; Wed, 14 Aug 2019 21:50:28 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "vit9696@protonmail.com" Subject: Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add STATIC_ASSERT macro Thread-Topic: [edk2-devel] [PATCH v2 1/1] MdePkg: Add STATIC_ASSERT macro Thread-Index: AQHVUa97os3cx0KYQ0KimeIZG7up46b6qpTw Date: Wed, 14 Aug 2019 13:50:27 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4D0EC7@SHSMSX104.ccr.corp.intel.com> References: <20190813081644.53963-1-vit9696@protonmail.com> <20190813081644.53963-2-vit9696@protonmail.com> In-Reply-To: <20190813081644.53963-2-vit9696@protonmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2ViZDgxMDMtODQwOS00OGY4LThjYmUtYmY3NTQ3ZTc1ZWJkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoid1M1WTJFQkJ1RXkxaHJjTUNlOEV1Tng3Q1B6cnc4UURCUEZxVFwvbUtVZWc0VCt5bjlPRlNGXC9TcWNtZkdFTDNHIn0= dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Can you add the sample usage of new macro STATIC_ASSERT? Or, give the link of static_assert or _Static_assert.=20 If so, the developer knows how to use them in source code.=20 Thanks Liming > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of vit= 9696 via Groups.Io > Sent: Tuesday, August 13, 2019 4:17 PM > To: devel@edk2.groups.io > Subject: [edk2-devel] [PATCH v2 1/1] MdePkg: Add STATIC_ASSERT macro >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2048 >=20 > Provide a macro for compile time assertions. > Equivalent to C11 static_assert macro from assert.h. >=20 > Signed-off-by: Vitaly Cheptsov > --- > MdePkg/Include/Base.h | 11 +++++++++++ > 1 file changed, 11 insertions(+) >=20 > 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 >=20 > +/// > +/// 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 spe= cified field of > that data structure. This is a lightweight method to hide information= by placing a > -- > 2.20.1 (Apple Git-117) >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > View/Reply Online (#45503): https://edk2.groups.io/g/devel/message/45503 > Mute This Topic: https://groups.io/mt/32850582/1759384 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [liming.gao@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D