summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERT-and-NULL-definition-so-we-can-c.patch
blob: 4a3b26c7737f9ba5ae8de78cd859c3bc3291fa22 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From cc0e412ad05574d22938586172c56863666eb2a5 Mon Sep 17 00:00:00 2001
From: Nolan Hergert <nolan.hergert@intel.com>
Date: Mon, 5 Apr 2021 11:15:09 +0800
Subject: [PATCH] Ignore STATIC_ASSERT and NULL definition so we can compile in
 OS

Upstream-Status: Backport [from ipmctl patches; https://github.com/intel/ipmctl/blob/development/src/os/patches/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch]

Signed-off-by: Nolan Hergert <nolan.hergert@intel.com>
Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
---
 MdePkg/Include/Base.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index 8e4271f6ea..c39511a064 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -318,7 +318,11 @@ struct _LIST_ENTRY {
 ///
 /// NULL pointer (VOID *)
 ///
+#ifndef OS_BUILD
+#ifndef UNIT_TEST_UEFI_BUILD
 #define NULL  ((VOID *) 0)
+#endif
+#endif
 
 //
 // Null character
@@ -809,7 +813,8 @@ typedef UINTN  *BASE_LIST;
 // Verify that ProcessorBind.h produced UEFI Data Types that are compliant with
 // Section 2.3.1 of the UEFI 2.3 Specification.
 //
-
+#ifndef OS_BUILD
+#ifndef UNIT_TEST_UEFI_BUILD
 STATIC_ASSERT (sizeof (BOOLEAN) == 1, "sizeof (BOOLEAN) does not meet UEFI Specification Data Type requirements");
 STATIC_ASSERT (sizeof (INT8)    == 1, "sizeof (INT8) does not meet UEFI Specification Data Type requirements");
 STATIC_ASSERT (sizeof (UINT8)   == 1, "sizeof (UINT8) does not meet UEFI Specification Data Type requirements");
@@ -821,6 +826,8 @@ STATIC_ASSERT (sizeof (INT64)   == 8, "sizeof (INT64) does not meet UEFI Specifi
 STATIC_ASSERT (sizeof (UINT64)  == 8, "sizeof (UINT64) does not meet UEFI Specification Data Type requirements");
 STATIC_ASSERT (sizeof (CHAR8)   == 1, "sizeof (CHAR8) does not meet UEFI Specification Data Type requirements");
 STATIC_ASSERT (sizeof (CHAR16)  == 2, "sizeof (CHAR16) does not meet UEFI Specification Data Type requirements");
+#endif
+#endif
 
 //
 // The following three enum types are used to verify that the compiler
@@ -841,9 +848,13 @@ typedef enum {
   __VerifyUint32EnumValue = 0xffffffff
 } __VERIFY_UINT32_ENUM_SIZE;
 
+#ifndef OS_BUILD
+#ifndef UNIT_TEST_UEFI_BUILD
 STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
 STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
 STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements");
+#endif
+#endif
 
 /**
   Macro that returns a pointer to the data structure that contains a specified field of
-- 
2.17.1