From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.4589.1625697808229864323 for ; Wed, 07 Jul 2021 15:43:28 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: michael.d.kinney@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10037"; a="196570615" X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="196570615" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 15:43:23 -0700 X-IronPort-AV: E=Sophos;i="5.84,222,1620716400"; d="scan'208";a="482312179" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.209.48.134]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2021 15:43:22 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Liming Gao , Zhiguang Liu Subject: [Patch 1/1] MdePkg/Include: Add STATIC_ASSERT for L'' and L"" strings Date: Wed, 7 Jul 2021 15:43:10 -0700 Message-Id: <20210707224310.1665-1-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Add STATIC_ASSERT() macros to verify that the compiler is configured correctly for the use of L'' and L"" strings. Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Michael D Kinney --- MdePkg/Include/Base.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 8e4271f6eaf5..2da08b0c787f 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.
+Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
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 -- 2.32.0.windows.1