From 866706584c6622bd7f9f595c307422771ce1d564 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Fri, 13 Dec 2019 14:54:09 +0000 Subject: [PATCH] libctf: work with compilers not supporting GNU C attributes 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 62c2cc531ec..a8217fa4324 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,3 +1,11 @@ +2020-06-26 Nick Alcock + + 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 PR libctf/25120 diff --git a/libctf/ctf-impl.h b/libctf/ctf-impl.h index ade1a6e7cc4..133ca0ee6e2 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.30.2