summaryrefslogtreecommitdiff
path: root/EmulatorPkg/Win/Host/WinInclude.h
blob: be10a2ed393cdd8243644b5b6b31104497952d0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**@file
  Public include file for the WinNt Library

Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#pragma once

#undef VOID

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

#include "windows.h"
#include "windowsx.h"

#undef GUID
#undef _LIST_ENTRY
#undef LIST_ENTRY
#undef RUNTIME_FUNCTION
//
// Prevent collision with FAR field of EFI_SYSTEM_CONTEXT_AARCH64
//
#undef FAR

//
// Windows SDKs define IMAGE_FILE_MACHINE_ARM64 as "0xAA64"
// MdePkg defines EFI_IMAGE_FILE_MACHINE_ARM64 as "0xAA64"
// Mingw ucrt winnt.h defines IMAGE_FILE_MACHINE_ARM64 as "0xaa64" which is not
// the exact same string as "0xAA64". This generates a macro redefinition error
// with Mingw clang builds.
//
// Redefining a macro to the exact same string is not flagged an error.
//
// If IMAGE_FILE_MACHINE_ARM64 is defined, check if it matches the unexpected
// value of "0xaa64". If "0xaa64" is detected, then undefine and redefine to
// "0xAA64" which is the same value used in Windows SDKs and MdePkg includes.
//
#if defined (IMAGE_FILE_MACHINE_ARM64)
  #if IMAGE_FILE_MACHINE_ARM64 == 0xaa64
    #undef IMAGE_FILE_MACHINE_ARM64
#define IMAGE_FILE_MACHINE_ARM64  0xAA64
  #endif
#endif