Blame SOURCES/0014-efibind-Fix-usage-of-efi-headers-from-C-code.patch

4c0d37
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
4c0d37
From: Alexander von Gluck IV <kallisti5@unixzen.com>
4c0d37
Date: Wed, 27 Nov 2019 17:03:42 -0600
4c0d37
Subject: [PATCH] efibind: Fix usage of efi headers from C++ code
4c0d37
4c0d37
* __STDC_VERSION__ is undefined when headers are called from C++
4c0d37
  code resulting in not using stdint.h and efibind.h
4c0d37
  "making a guess" on what they are. extern "C" will not define
4c0d37
  __STDC_VERSION__.
4c0d37
* Always leverage stdint.h on C++.
4c0d37
* Honestly, gnu-efi should always use stdint.h, or find a better
4c0d37
  way to detect it. (or platforms without it need to catch up to 2007)
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   | 4 ++--
4c0d37
 6 files changed, 7 insertions(+), 7 deletions(-)
4c0d37
4c0d37
diff --git a/inc/aarch64/efibind.h b/inc/aarch64/efibind.h
4c0d37
index 3c8cf963c31..c2c546b892a 100644
4c0d37
--- a/inc/aarch64/efibind.h
4c0d37
+++ b/inc/aarch64/efibind.h
4c0d37
@@ -15,7 +15,7 @@
4c0d37
  * either version 2 of the License, or (at your option) any later version.
4c0d37
  */
4c0d37
 
4c0d37
-#if !defined(_MSC_VER) && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L ))
4c0d37
+#if !defined(_MSC_VER) && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )) && !defined(__cplusplus)
4c0d37
 
4c0d37
 // ANSI C 1999/2000 stdint.h integer width declarations
4c0d37
 
4c0d37
diff --git a/inc/arm/efibind.h b/inc/arm/efibind.h
4c0d37
index 7a22b9c8458..012d3d2f8c9 100644
4c0d37
--- a/inc/arm/efibind.h
4c0d37
+++ b/inc/arm/efibind.h
4c0d37
@@ -15,7 +15,7 @@
4c0d37
  * either version 2 of the License, or (at your option) any later version.
4c0d37
  */
4c0d37
 
4c0d37
-#if !defined(_MSC_VER) && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L ))
4c0d37
+#if !defined(_MSC_VER) && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )) && !defined(__cplusplus)
4c0d37
 
4c0d37
 // ANSI C 1999/2000 stdint.h integer width declarations
4c0d37
 
4c0d37
diff --git a/inc/ia32/efibind.h b/inc/ia32/efibind.h
4c0d37
index dd0138573d9..27459e454d1 100644
4c0d37
--- a/inc/ia32/efibind.h
4c0d37
+++ b/inc/ia32/efibind.h
4c0d37
@@ -25,7 +25,7 @@ Revision History
4c0d37
 // Basic int types of various widths
4c0d37
 //
4c0d37
 
4c0d37
-#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )
4c0d37
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L ) && !defined(__cplusplus)
4c0d37
 
4c0d37
     // No ANSI C 1999/2000 stdint.h integer width declarations 
4c0d37
 
4c0d37
diff --git a/inc/ia64/efibind.h b/inc/ia64/efibind.h
4c0d37
index b9b2e624657..3ace8d59190 100644
4c0d37
--- a/inc/ia64/efibind.h
4c0d37
+++ b/inc/ia64/efibind.h
4c0d37
@@ -24,7 +24,7 @@ Revision History
4c0d37
 // Basic int types of various widths
4c0d37
 //
4c0d37
 
4c0d37
-#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )
4c0d37
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L ) && !defined(__cplusplus)
4c0d37
 
4c0d37
     // No ANSI C 1999/2000 stdint.h integer width declarations 
4c0d37
 
4c0d37
diff --git a/inc/mips64el/efibind.h b/inc/mips64el/efibind.h
4c0d37
index 32241e5ad46..1f08cd346d0 100644
4c0d37
--- a/inc/mips64el/efibind.h
4c0d37
+++ b/inc/mips64el/efibind.h
4c0d37
@@ -17,7 +17,7 @@
4c0d37
  * either version 2 of the License, or (at your option) any later version.
4c0d37
  */
4c0d37
 
4c0d37
-#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )
4c0d37
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L ) && !defined(__cplusplus)
4c0d37
 
4c0d37
 // ANSI C 1999/2000 stdint.h integer width declarations
4c0d37
 
4c0d37
diff --git a/inc/x86_64/efibind.h b/inc/x86_64/efibind.h
4c0d37
index ae40595be0b..31e9e119d74 100644
4c0d37
--- a/inc/x86_64/efibind.h
4c0d37
+++ b/inc/x86_64/efibind.h
4c0d37
@@ -34,7 +34,7 @@ Revision History
4c0d37
 // Basic int types of various widths
4c0d37
 //
4c0d37
 
4c0d37
-#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L )
4c0d37
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L ) && !defined(__cplusplus)
4c0d37
 
4c0d37
     // No ANSI C 1999/2000 stdint.h integer width declarations 
4c0d37
 
4c0d37
@@ -86,7 +86,7 @@ Revision History
4c0d37
     #endif
4c0d37
     typedef uint64_t            uintptr_t;
4c0d37
     typedef int64_t             intptr_t;
4c0d37
-#elif defined(__GNUC__)
4c0d37
+#else
4c0d37
     #include <stdint.h>
4c0d37
 #endif
4c0d37