X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=CryptoPkg%2FLibrary%2FBaseCryptLib%2FSysCall%2FCrtWrapper.c;h=fb446b677044c35764c9e86bf1c7e8782ced1901;hp=46574dc8f545caa70438f60eb4368a5f804c270c;hb=b7d320f8117ed2fffe001b1a0b7bfcd4f40fafc4;hpb=8e01b449de91cfcd1bdf473ae1bc766c22eb616e
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
index 46574dc8f5..fb446b6770 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
@@ -2,7 +2,7 @@
C Run-Time Libraries (CRT) Wrapper Implementation for OpenSSL-based
Cryptographic Library.
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -17,6 +17,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
int errno = 0;
+FILE *stderr = NULL;
+FILE *stdin = NULL;
+FILE *stdout = NULL;
+
typedef
INTN
(*SORT_COMPARE)(
@@ -240,7 +244,10 @@ void qsort (void *base, size_t num, size_t width, int (*compare)(const void *, c
ASSERT (base != NULL);
ASSERT (compare != NULL);
- Buffer = AllocatePool (width);
+ //
+ // Use CRT-style malloc to cover BS and RT memory allocation.
+ //
+ Buffer = malloc (width);
ASSERT (Buffer != NULL);
//
@@ -248,7 +255,7 @@ void qsort (void *base, size_t num, size_t width, int (*compare)(const void *, c
//
QuickSortWorker (base, (UINTN)num, (UINTN)width, (SORT_COMPARE)compare, Buffer);
- FreePool (Buffer);
+ free (Buffer);
return;
}
@@ -326,11 +333,42 @@ void closelog (void)
}
+#ifdef __GNUC__
+
+typedef
+VOID
+(EFIAPI *NoReturnFuncPtr)(
+ VOID
+ ) __attribute__((__noreturn__));
+
+
+STATIC
+VOID
+EFIAPI
+NopFunction (
+ VOID
+ )
+{
+}
+
+
void exit (int e)
{
+ NoReturnFuncPtr NoReturnFunc;
+
+ NoReturnFunc = (NoReturnFuncPtr) NopFunction;
+ NoReturnFunc ();
}
+#else
+
+void exit (int e)
+{
+}
+
+#endif
+
int fclose (FILE *f)
{
return 0;