Skip to content

Commit

Permalink
CryptoPkg: move define to CrtLibSupport
Browse files Browse the repository at this point in the history
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4632

The before code will cause redefine error.
This patch move them to CrtLibSupport header.
But Openssl has already defined them internally,
need to increase support for OPENSLL_SYS_UEFI judgment.

Cc: Jiewen Yao <[email protected]>
Cc: Yi Li <[email protected]>
Cc: Guomin Jiang <[email protected]>
Signed-off-by: Wenxing Hou <[email protected]>
Reviewed-by: Yi Li <[email protected]>
  • Loading branch information
Wenxing-hou authored and mergify[bot] committed Jan 4, 2024
1 parent 16c8cfc commit e449451
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
15 changes: 15 additions & 0 deletions CryptoPkg/Library/Include/CrtLibSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,4 +424,19 @@ strcpy (
#define atoi(nptr) AsciiStrDecimalToUintn(nptr)
#define gettimeofday(tvp, tz) do { (tvp)->tv_sec = time(NULL); (tvp)->tv_usec = 0; } while (0)

//
// only use in Mbedlts. The Openssl has defined them internally.
//
#ifndef OPENSSL_SYS_UEFI
typedef INT8 int8_t;
typedef UINT8 uint8_t;
typedef INT16 int16_t;
typedef UINT16 uint16_t;
typedef INT32 int32_t;
typedef UINT32 uint32_t;
typedef INT64 int64_t;
typedef UINT64 uint64_t;
typedef UINTN uintptr_t;
#endif

#endif
10 changes: 0 additions & 10 deletions CryptoPkg/Library/Include/stdint.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,3 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <CrtLibSupport.h>

typedef INT8 int8_t;
typedef UINT8 uint8_t;
typedef INT16 int16_t;
typedef UINT16 uint16_t;
typedef INT32 int32_t;
typedef UINT32 uint32_t;
typedef INT64 int64_t;
typedef UINT64 uint64_t;
typedef UINTN uintptr_t;

0 comments on commit e449451

Please sign in to comment.