This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 08/11] libctf: work with compilers not supporting GNU C attributes
- From: Nick Alcock <nick dot alcock at oracle dot com>
- To: binutils at sourceware dot org
- Cc: indu dot bhagat at oracle dot com, jose dot marchesi at oracle dot com, nick dot alcock at oracle dot com
- Date: Mon, 16 Dec 2019 22:53:54 +0000
- Subject: [PATCH 08/11] libctf: work with compilers not supporting GNU C attributes
- References: <20191216225357.87247-1-nick.alcock@oracle.com>
The obvious fallback __attribute__ stanza was missing.
Thanks to Harald van Dijk.
PR 25120
libctf/
* ctf-impl.h (_libctf_printflike_): Add non-GNU-C fallback.
(_libctf_unlikely_): Likewise.
(_libctf_unused): Likewise.
(_libctf_malloc_): Likewise.
---
libctf/ChangeLog | 8 ++++++++
libctf/ctf-impl.h | 7 +++++++
2 files changed, 15 insertions(+)
diff --git a/libctf/ChangeLog b/libctf/ChangeLog
index 7b0e9e6fa7..7550015cab 100644
--- a/libctf/ChangeLog
+++ b/libctf/ChangeLog
@@ -1,3 +1,11 @@
+2019-12-16 Nick Alcock <nick.alcock@oracle.com>
+
+ PR libctf/25120
+ * ctf-impl.h (_libctf_printflike_): Add non-GNU-C fallback.
+ (_libctf_unlikely_): Likewise.
+ (_libctf_unused): Likewise.
+ (_libctf_malloc_): Likewise.
+
2019-12-16 Nick Alcock <nick.alcock@oracle.com>
PR libctf/25120
diff --git a/libctf/ctf-impl.h b/libctf/ctf-impl.h
index de855b5883..5a2ad464ae 100644
--- a/libctf/ctf-impl.h
+++ b/libctf/ctf-impl.h
@@ -59,6 +59,13 @@ extern "C"
#define _libctf_unused_ __attribute__ ((__unused__))
#define _libctf_malloc_ __attribute__((__malloc__))
+#else
+
+#define _libctf_printflike_(string_index,first_to_check)
+#define _libctf_unlikely_(x) (x)
+#define _libctf_unused_
+#define _libctf_malloc_
+
#endif
/* libctf in-memory state. */
--
2.24.1.242.gb57e918ca5