mirror of https://github.com/acidanthera/audk.git
MdePkg: Update Base.h to be compliant with C11
With the introduction of the use of _Static_assert, edk2 requires a C11 compatible compiler. Update Include/Base.h to be compliant with C11. As of C11, the maximum type of an enum is type `int`. Since the UEFI Specification 2.3.1 Errata C allows either `int` or `unsigned int`, fix the 32-bit enum check to use a signed int. Since the UEFI 2.3 Specification only allowed signed int, update the comment to reference 2.3.1 Errata C where the change was made to allow unsigned int. Signed-off-by: Rebecca Cran <rebecca@quicinc.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
parent
410ca0ff94
commit
d6107c593b
|
@ -796,9 +796,9 @@ STATIC_ASSERT (sizeof (L"A") == 4, "sizeof (L\"A\") does not meet UEFI Specif
|
||||||
//
|
//
|
||||||
// The following three enum types are used to verify that the compiler
|
// The following three enum types are used to verify that the compiler
|
||||||
// configuration for enum types is compliant with Section 2.3.1 of the
|
// configuration for enum types is compliant with Section 2.3.1 of the
|
||||||
// UEFI 2.3 Specification. These enum types and enum values are not
|
// UEFI 2.3.1 Errata C Specification. These enum types and enum values
|
||||||
// intended to be used. A prefix of '__' is used avoid conflicts with
|
// are not intended to be used. A prefix of '__' is used avoid
|
||||||
// other types.
|
// conflicts with other types.
|
||||||
//
|
//
|
||||||
typedef enum {
|
typedef enum {
|
||||||
__VerifyUint8EnumValue = 0xff
|
__VerifyUint8EnumValue = 0xff
|
||||||
|
@ -809,12 +809,12 @@ typedef enum {
|
||||||
} __VERIFY_UINT16_ENUM_SIZE;
|
} __VERIFY_UINT16_ENUM_SIZE;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
__VerifyUint32EnumValue = 0xffffffff
|
__VerifyInt32EnumValue = 0x7fffffff
|
||||||
} __VERIFY_UINT32_ENUM_SIZE;
|
} __VERIFY_INT32_ENUM_SIZE;
|
||||||
|
|
||||||
STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
|
STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
|
||||||
STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
|
STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
|
||||||
STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
|
STATIC_ASSERT (sizeof (__VERIFY_INT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Macro that returns a pointer to the data structure that contains a specified field of
|
Macro that returns a pointer to the data structure that contains a specified field of
|
||||||
|
|
Loading…
Reference in New Issue