Skip to content

Commit

Permalink
MdePkg/BaseOverflowLib: Support BASE_ALIGNAS on VS2019
Browse files Browse the repository at this point in the history
Note: this must be combined with flag /wd4324 added to MSFT:*_CC_FLAGS
to avoid spurious warnings when the macro is working as intended.
  • Loading branch information
mikebeaton committed Nov 27, 2024
1 parent bf8a429 commit 39da25c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MdePkg/Include/Library/BaseOverflowLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// Force member alignment for the structure.
//
#if (defined (__STDC__) && __STDC_VERSION__ >= 201112L) || defined (__GNUC__) || defined (__clang__)
#if defined (_MSC_VER)
#define BASE_ALIGNAS(Alignment) __declspec(align(Alignment))
#elif (defined (__STDC__) && __STDC_VERSION__ >= 201112L) || defined (__GNUC__) || defined (__clang__)
#define BASE_ALIGNAS(Alignment) _Alignas(Alignment)
#else
#define BASE_ALIGNAS(Alignment)
Expand Down

0 comments on commit 39da25c

Please sign in to comment.