C Run-Time Libraries (CRT) Wrapper Implementation for OpenSSL-based\r
Cryptographic Library.\r
\r
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
int errno = 0;\r
\r
FILE *stderr = NULL;\r
-FILE *stdin = NULL;\r
+FILE *stdin = NULL;\r
FILE *stdout = NULL;\r
\r
typedef\r
-INTN\r
+int\r
(*SORT_COMPARE)(\r
IN VOID *Buffer1,\r
IN VOID *Buffer2\r
ASSERT (base != NULL);\r
ASSERT (compare != NULL);\r
\r
- Buffer = AllocatePool (width);\r
+ //\r
+ // Use CRT-style malloc to cover BS and RT memory allocation.\r
+ //\r
+ Buffer = malloc (width);\r
ASSERT (Buffer != NULL);\r
\r
//\r
//\r
QuickSortWorker (base, (UINTN)num, (UINTN)width, (SORT_COMPARE)compare, Buffer);\r
\r
- FreePool (Buffer);\r
+ free (Buffer);\r
return;\r
}\r
\r
\r
}\r
\r
+#ifdef __GNUC__\r
+\r
+typedef\r
+VOID\r
+(EFIAPI *NoReturnFuncPtr)(\r
+ VOID\r
+ ) __attribute__((__noreturn__));\r
+\r
+\r
+STATIC\r
+VOID\r
+EFIAPI\r
+NopFunction (\r
+ VOID\r
+ )\r
+{\r
+}\r
+\r
+\r
void exit (int e)\r
{\r
+ NoReturnFuncPtr NoReturnFunc;\r
+\r
+ NoReturnFunc = (NoReturnFuncPtr) NopFunction;\r
\r
+ NoReturnFunc ();\r
}\r
\r
+#else\r
+\r
+void exit (int e)\r
+{\r
+}\r
+\r
+#endif\r
+\r
int fclose (FILE *f)\r
{\r
return 0;\r
return 0;\r
}\r
\r
+int fputs (const char *s, FILE *f)\r
+{\r
+ return 0;\r
+}\r
+\r
int fprintf (FILE *f, const char *s, ...)\r
{\r
return 0;\r
{\r
return 0;\r
}\r
+\r
+int printf (char const *fmt, ...)\r
+{\r
+ return 0;\r
+}\r