Root include file of C runtime library to support building the third-party\r
cryptographic library.\r
\r
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2019, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
#define MAX_STRING_SIZE 0x1000\r
\r
+//\r
+// We already have "no-ui" in out Configure invocation.\r
+// but the code still fails to compile.\r
+// Ref: https://github.com/openssl/openssl/issues/8904\r
+//\r
+// This is defined in CRT library(stdio.h).\r
+//\r
+#ifndef BUFSIZ\r
+#define BUFSIZ 8192\r
+#endif\r
+\r
//\r
// OpenSSL relies on explicit configuration for word size in crypto/bn,\r
// but we want it to be automatically inferred from the target. So we\r
\r
#define CONFIG_HEADER_BN_H\r
\r
-#if defined(MDE_CPU_X64) || defined(MDE_CPU_AARCH64) || defined(MDE_CPU_IA64)\r
+#if defined(MDE_CPU_X64) || defined(MDE_CPU_AARCH64) || defined(MDE_CPU_IA64) || defined(MDE_CPU_RISCV64)\r
//\r
// With GCC we would normally use SIXTY_FOUR_BIT_LONG, but MSVC needs\r
// SIXTY_FOUR_BIT, because 'long' is 32-bit and only 'long long' is\r
// Definitions for global constants used by CRT library routines\r
//\r
#define EINVAL 22 /* Invalid argument */\r
+#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */\r
#define INT_MAX 0x7FFFFFFF /* Maximum (signed) int value */\r
#define LONG_MAX 0X7FFFFFFFL /* max value for a long */\r
#define LONG_MIN (-LONG_MAX-1) /* min value for a long */\r
#define ULONG_MAX 0xFFFFFFFF /* Maximum unsigned long value */\r
#define CHAR_BIT 8 /* Number of bits in a char */\r
\r
+//\r
+// Address families.\r
+//\r
+#define AF_INET 2 /* internetwork: UDP, TCP, etc. */\r
+#define AF_INET6 24 /* IP version 6 */\r
+\r
+//\r
+// Define constants based on RFC0883, RFC1034, RFC 1035\r
+//\r
+#define NS_INT16SZ 2 /*%< #/bytes of data in a u_int16_t */\r
+#define NS_INADDRSZ 4 /*%< IPv4 T_A */\r
+#define NS_IN6ADDRSZ 16 /*%< IPv6 T_AAAA */\r
+\r
//\r
// Basic types mapping\r
//\r
typedef UINTN size_t;\r
+typedef UINTN u_int;\r
typedef INTN ssize_t;\r
typedef INT32 time_t;\r
typedef UINT8 __uint8_t;\r
typedef UINT8 sa_family_t;\r
+typedef UINT8 u_char;\r
typedef UINT32 uid_t;\r
typedef UINT32 gid_t;\r
\r
int tolower (int);\r
int strcmp (const char *, const char *);\r
int strncasecmp (const char *, const char *, size_t);\r
+char *strchr (const char *, int);\r
char *strrchr (const char *, int);\r
unsigned long strtoul (const char *, char **, int);\r
long strtol (const char *, char **, int);\r
#else\r
void abort (void);\r
#endif\r
+int inet_pton (int, const char *, void *);\r
\r
//\r
// Macros that directly map functions to BaseLib, BaseMemoryLib, and DebugLib functions\r
#define strcpy(strDest,strSource) AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource)\r
#define strncpy(strDest,strSource,count) AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count)\r
#define strcat(strDest,strSource) AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource)\r
-#define strchr(str,ch) ScanMem8((VOID *)(str),AsciiStrSize(str),(UINT8)ch)\r
#define strncmp(string1,string2,count) (int)(AsciiStrnCmp(string1,string2,(UINTN)(count)))\r
#define strcasecmp(str1,str2) (int)AsciiStriCmp(str1,str2)\r
#define sprintf(buf,...) AsciiSPrint(buf,MAX_STRING_SIZE,__VA_ARGS__)\r