Blame SOURCES/0005-Fix-for-problem-with-undeclared-intptr_t-type.patch

4c0d37
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
4c0d37
From: Esben Haabendal <esben@esben1.localdomain>
4c0d37
Date: Fri, 15 Mar 2019 11:57:51 +0100
4c0d37
Subject: [PATCH] Fix for problem with undeclared intptr_t type
4c0d37
4c0d37
When building gnu-efi with old compilers with pre C90 compilers:
4c0d37
4c0d37
In file included from gnu-efi-3.0.9/lib/../inc/efilib.h:25:0,
4c0d37
                 from gnu-efi-3.0.9/lib/lib.h:24,
4c0d37
                 from gnu-efi-3.0.9/lib/dpath.c:25:
4c0d37
gnu-efi-3.0.9/lib/dpath.c: In function 'FileDevicePath':
4c0d37
gnu-efi-3.0.9/lib/../inc/efilink.h:145:47: error: 'intptr_t' undeclared (first use in this function)
4c0d37
 #define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(intptr_t)(&(((TYPE *) 0)->Field)))
4c0d37
4c0d37
Problem introduced with commit a46a62b12b58139c31d4288384808365c4053bf2
4c0d37
(Fix some types gcc doesn't like).
4c0d37
4c0d37
Avoid this by adding intptr_t (and uintptr_t) typedefs for builds that does
4c0d37
not include stdint.h.
4c0d37
4c0d37
Signed-off-by: Esben Haabendal <esben@esben1.localdomain>
4c0d37
---
4c0d37
 inc/aarch64/efibind.h  | 2 ++
4c0d37
 inc/arm/efibind.h      | 2 ++
4c0d37
 inc/ia32/efibind.h     | 2 ++
4c0d37
 inc/ia64/efibind.h     | 2 ++
4c0d37
 inc/mips64el/efibind.h | 2 ++
4c0d37
 inc/x86_64/efibind.h   | 2 ++
4c0d37
 6 files changed, 12 insertions(+)
4c0d37
4c0d37
diff --git a/inc/aarch64/efibind.h b/inc/aarch64/efibind.h
4c0d37
index bdaa5238e84..3c8cf963c31 100644
4c0d37
--- a/inc/aarch64/efibind.h
4c0d37
+++ b/inc/aarch64/efibind.h
4c0d37
@@ -27,6 +27,8 @@ typedef unsigned short      uint16_t;
4c0d37
 typedef short               int16_t;
4c0d37
 typedef unsigned char       uint8_t;
4c0d37
 typedef signed char         int8_t;   // unqualified 'char' is unsigned on ARM
4c0d37
+typedef uint64_t            uintptr_t;
4c0d37
+typedef int64_t             intptr_t;
4c0d37
 
4c0d37
 #else
4c0d37
 #include <stdint.h>
4c0d37
diff --git a/inc/arm/efibind.h b/inc/arm/efibind.h
4c0d37
index 40a5a9cd428..7a22b9c8458 100644
4c0d37
--- a/inc/arm/efibind.h
4c0d37
+++ b/inc/arm/efibind.h
4c0d37
@@ -27,6 +27,8 @@ typedef unsigned short      uint16_t;
4c0d37
 typedef short               int16_t;
4c0d37
 typedef unsigned char       uint8_t;
4c0d37
 typedef signed char         int8_t;   // unqualified 'char' is unsigned on ARM
4c0d37
+typedef uint32_t            uintptr_t;
4c0d37
+typedef int32_t             intptr_t;
4c0d37
 
4c0d37
 #else
4c0d37
 #include <stdint.h>
4c0d37
diff --git a/inc/ia32/efibind.h b/inc/ia32/efibind.h
4c0d37
index 1b11f10a6d3..dd0138573d9 100644
4c0d37
--- a/inc/ia32/efibind.h
4c0d37
+++ b/inc/ia32/efibind.h
4c0d37
@@ -75,6 +75,8 @@ Revision History
4c0d37
        typedef unsigned char       uint8_t;
4c0d37
        typedef char                int8_t;
4c0d37
     #endif
4c0d37
+    typedef uint32_t            uintptr_t;
4c0d37
+    typedef int32_t             intptr_t;
4c0d37
 #elif defined(__GNUC__)
4c0d37
     #include <stdint.h>
4c0d37
 #endif
4c0d37
diff --git a/inc/ia64/efibind.h b/inc/ia64/efibind.h
4c0d37
index b415461b10c..b9b2e624657 100644
4c0d37
--- a/inc/ia64/efibind.h
4c0d37
+++ b/inc/ia64/efibind.h
4c0d37
@@ -62,6 +62,8 @@ Revision History
4c0d37
         typedef unsigned char       uint8_t;
4c0d37
         typedef char                int8_t;
4c0d37
     #endif
4c0d37
+    typedef uint64_t            uintptr_t;
4c0d37
+    typedef int64_t             intptr_t;
4c0d37
 #elif defined(__GNUC__)
4c0d37
     #include <stdint.h>
4c0d37
 #endif
4c0d37
diff --git a/inc/mips64el/efibind.h b/inc/mips64el/efibind.h
4c0d37
index 4adbca31d63..32241e5ad46 100644
4c0d37
--- a/inc/mips64el/efibind.h
4c0d37
+++ b/inc/mips64el/efibind.h
4c0d37
@@ -29,6 +29,8 @@ typedef unsigned short      uint16_t;
4c0d37
 typedef short               int16_t;
4c0d37
 typedef unsigned char       uint8_t;
4c0d37
 typedef signed char         int8_t;   // unqualified 'char' is unsigned on ARM
4c0d37
+typedef uint64_t            uintptr_t;
4c0d37
+typedef int64_t             intptr_t;
4c0d37
 
4c0d37
 #else
4c0d37
 #include <stdint.h>
4c0d37
diff --git a/inc/x86_64/efibind.h b/inc/x86_64/efibind.h
4c0d37
index 4309f9f0e17..ae40595be0b 100644
4c0d37
--- a/inc/x86_64/efibind.h
4c0d37
+++ b/inc/x86_64/efibind.h
4c0d37
@@ -84,6 +84,8 @@ Revision History
4c0d37
        typedef unsigned char       uint8_t;
4c0d37
        typedef char                int8_t;
4c0d37
     #endif
4c0d37
+    typedef uint64_t            uintptr_t;
4c0d37
+    typedef int64_t             intptr_t;
4c0d37
 #elif defined(__GNUC__)
4c0d37
     #include <stdint.h>
4c0d37
 #endif