honggfuzz/0003-linux-bfd-cover-include-diagnostics.h-with-__has_inc.patch

30 lines
745 B
Diff
Raw Normal View History

From 6a757bb7a091d64b145d4e1a9b6c50f6b3ed51ea Mon Sep 17 00:00:00 2001
From: Robert Swiecki <robert@swiecki.net>
Date: Mon, 6 Jun 2022 18:11:28 +0200
Subject: [PATCH 3/3] linux/bfd: cover #include <diagnostics.h> with
__has_include, because it appeared in 2018 only
---
linux/bfd.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/linux/bfd.c b/linux/bfd.c
index e9d9c2b..adae590 100644
--- a/linux/bfd.c
+++ b/linux/bfd.c
@@ -26,7 +26,11 @@
#include "linux/bfd.h"
#include <bfd.h>
+#if defined __has_include
+#if __has_include(<diagnostics.h>)
#include <diagnostics.h>
+#endif /* __has_include(<diagnostics.h>) */
+#endif /* defined __has_include */
#include <dis-asm.h>
#include <inttypes.h>
#include <pthread.h>
--
2.37.2