diff options
author | Alexander Gryanko <xpahos@gmail.com> | 2025-06-24 02:54:17 +0300 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-08-07 01:18:26 +0000 |
commit | 5125e2d6b1cd18f73bfed2ad21f29167c64a01e9 (patch) | |
tree | d159ac15a1620dbeb78bc91793e80a3397f1acb9 | |
parent | d55642f53785f316c5aa790522b6d5133c5b78cc (diff) | |
download | edk2-5125e2d6b1cd18f73bfed2ad21f29167c64a01e9.zip edk2-5125e2d6b1cd18f73bfed2ad21f29167c64a01e9.tar.gz edk2-5125e2d6b1cd18f73bfed2ad21f29167c64a01e9.tar.bz2 |
CryptoPkg: workaround for MSVC linking tolower
Currently when building NOOPT tests in MSVC, the linker cannot
pick the correct tolower for the host runtime. A small
workaround to make the build work in MSVC.
Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
-rw-r--r-- | CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c index 3aa76e0..e83d190 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c @@ -14,10 +14,23 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include <Library/DebugLib.h>
/* Convert character to lowercase */
+#ifdef _MSC_VER
+//
+// Workaround for building NOOPT on Windows systems. Due to disabled
+// optimization, the MSVC compiler cannot hide this function
+// implementation from the linker.
+//
+int
+tolower_noos (
+ int c
+ )
+ #pragma comment(linker, "/alternatename:tolower=tolower_noos")
+#else
int
tolower (
int c
)
+#endif
{
if (('A' <= (c)) && ((c) <= 'Z')) {
return (c - ('A' - 'a'));
|