Skip to content

Commit

Permalink
BaseTools: Fixed VS2022 compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Krichanov committed Dec 13, 2023
1 parent 35cf7dc commit 4cd039b
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 9 deletions.
28 changes: 28 additions & 0 deletions BaseTools/Source/C/Common/WinNtInclude.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/** @file
Include file for the WinNt Library
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef __WIN_NT_INCLUDE_H__
#define __WIN_NT_INCLUDE_H__

#define GUID _WINNT_DUP_GUID_____
#define _LIST_ENTRY _WINNT_DUP_LIST_ENTRY_FORWARD
#define LIST_ENTRY _WINNT_DUP_LIST_ENTRY

#ifndef __GNUC__
#include "windows.h"
#endif

#undef GUID
#undef _LIST_ENTRY
#undef LIST_ENTRY

//
// FAR is used as a struct member name by DebugSupport.h.
//
#undef FAR
#endif
3 changes: 2 additions & 1 deletion BaseTools/Source/C/GenFfs/GenFfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include "WinNtInclude.h"

#ifndef __GNUC__
#include <windows.h>
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand Down
4 changes: 3 additions & 1 deletion BaseTools/Source/C/GenSec/GenSec.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include "WinNtInclude.h"

#ifndef __GNUC__
#include <windows.h>
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand Down
2 changes: 2 additions & 0 deletions BaseTools/Source/C/Include/Common/BaseTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#ifndef __BT_BASE_TYPES_H__
#define __BT_BASE_TYPES_H__

#include "WinNtInclude.h"

#include <stdarg.h>
#include <stdint.h>

Expand Down
2 changes: 2 additions & 0 deletions BaseTools/Source/C/LzmaCompress/LzmaCompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#define _CRT_SECURE_NO_WARNINGS

#include "WinNtInclude.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
8 changes: 1 addition & 7 deletions CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@

[Sources]
MemoryIntrinsics.c

[Sources.IA32]
CopyMem.c

[Sources.IA32]
Ia32/MathDivU64xU64Rem.c | MSFT
Ia32/MathLShiftS64.c | MSFT
Ia32/MathRShiftU64.c | MSFT
Expand All @@ -36,7 +35,6 @@
Ia32/MathUlldiv.asm | MSFT
Ia32/MathUlldvrm.asm | MSFT
Ia32/MathLldiv.asm | MSFT
Ia32/MathUllrem.asm | MSFT

Ia32/MathDivU64xU64Rem.c | INTEL
Ia32/MathLShiftS64.c | INTEL
Expand All @@ -49,10 +47,6 @@
Ia32/MathDivS64x64.c | GCC
Ia32/MathDivU64x64.c | GCC
Ia32/MathModU64x64.c | GCC
[Sources.X64]
CopyMem.c
[Sources.RISCV64]
CopyMem.c

[Packages]
MdePkg/MdePkg.dec
Expand Down

0 comments on commit 4cd039b

Please sign in to comment.