public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Liming Gao" <liming.gao@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"philmd@redhat.com" <philmd@redhat.com>,
	"vit9696@protonmail.com" <vit9696@protonmail.com>
Subject: Re: [edk2-devel] [PATCH v3 1/1] MdePkg: Add STATIC_ASSERT macro
Date: Thu, 12 Sep 2019 01:21:06 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4F73DF@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <d849b8ce-8910-8886-d5fd-f433e6e28a9f@redhat.com>

Push @204ae9da230ecbf0910c21acac7aa5d5e8cbb8d0

>-----Original Message-----
>From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
>Philippe Mathieu-Daudé
>Sent: Tuesday, September 10, 2019 2:30 PM
>To: devel@edk2.groups.io; vit9696@protonmail.com
>Subject: Re: [edk2-devel] [PATCH v3 1/1] MdePkg: Add STATIC_ASSERT macro
>
>On 8/17/19 1:28 AM, Vitaly Cheptsov via Groups.Io wrote:
>> 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 <vit9696@protonmail.com>
>> ---
>>  MdePkg/Include/Base.h | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
>> index ce20b5f01d..ec096133ba 100644
>> --- a/MdePkg/Include/Base.h
>> +++ b/MdePkg/Include/Base.h
>> @@ -843,6 +843,20 @@ 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.
>> +
>> +  @param  Expression  Boolean expression.
>> +  @param  Message     Raised compiler diagnostic message when
>expression is false.
>> +
>> +**/
>> +#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
>>
>
>Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
>
>


      reply	other threads:[~2019-09-12  1:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16 23:28 [PATCH v3 0/1] MdePkg: Add STATIC_ASSERT macro Vitaly Cheptsov
2019-08-16 23:28 ` [PATCH v3 1/1] " Vitaly Cheptsov
2019-09-07 16:31   ` [edk2-devel] " Vitaly Cheptsov
2019-09-09  7:57     ` Liming Gao
2019-09-09 23:04       ` Vitaly Cheptsov
2019-09-10  6:30   ` Philippe Mathieu-Daudé
2019-09-12  1:21     ` Liming Gao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E4F73DF@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox