summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2021-07-07 11:27:37 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-07-09 23:43:45 +0000
commitad1009ec626bea7a718d595f98f0ad49a16c6e5b (patch)
treee5eaf19c36646bff2c55e2b82d5662477e25fe9b
parent5ef08a49e3411a56a2afedbb11127279033c8915 (diff)
downloadedk2-ad1009ec626bea7a718d595f98f0ad49a16c6e5b.tar.gz
edk2-ad1009ec626bea7a718d595f98f0ad49a16c6e5b.tar.bz2
edk2-ad1009ec626bea7a718d595f98f0ad49a16c6e5b.zip
MdePkg/Include: Add STATIC_ASSERT for L'' and L"" strings
Add STATIC_ASSERT() macros to verify that the compiler is configured correctly for the use of L'' and L"" strings. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>
-rw-r--r--MdePkg/Include/Base.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 8e4271f6ea..2da08b0c78 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -6,7 +6,7 @@
environment. There are a set of base libraries in the Mde Package that can
be used to implement base modules.
-Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -821,6 +821,8 @@ STATIC_ASSERT (sizeof (INT64) == 8, "sizeof (INT64) does not meet UEFI Specifi
STATIC_ASSERT (sizeof (UINT64) == 8, "sizeof (UINT64) does not meet UEFI Specification Data Type requirements");
STATIC_ASSERT (sizeof (CHAR8) == 1, "sizeof (CHAR8) does not meet UEFI Specification Data Type requirements");
STATIC_ASSERT (sizeof (CHAR16) == 2, "sizeof (CHAR16) does not meet UEFI Specification Data Type requirements");
+STATIC_ASSERT (sizeof (L'A') == 2, "sizeof (L'A') does not meet UEFI Specification Data Type requirements");
+STATIC_ASSERT (sizeof (L"A") == 4, "sizeof (L\"A\") does not meet UEFI Specification Data Type requirements");
//
// The following three enum types are used to verify that the compiler