libctf: work with compilers not supporting GNU C attributes
authorNick Alcock <nick.alcock@oracle.com>
Fri, 13 Dec 2019 14:54:09 +0000 (14:54 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 26 Jun 2020 14:56:39 +0000 (15:56 +0100)
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
libctf/ctf-impl.h

index 62c2cc531ec32437e1019be968056b49dabcbd39..a8217fa4324094eb80647827a763ba9c2004ff4a 100644 (file)
@@ -1,3 +1,11 @@
+2020-06-26  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.
+
 2020-06-26  Nick Alcock  <nick.alcock@oracle.com>
 
        PR libctf/25120
index ade1a6e7cc453a760061391ea68294f3dd0b97dc..133ca0ee6e2373338db5c21451a18aa77293cf96 100644 (file)
@@ -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.  */