From d238707db3b54617f84cfd1d20e5fc4a35f64199 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 29 Aug 2014 11:14:31 +0200 Subject: [PATCH] src/collectd.h: Enable __attribute__() for clang, too. --- src/collectd.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/collectd.h b/src/collectd.h index 5650b59a..6886c123 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -271,8 +271,16 @@ typedef int _Bool; # define COLLECTD_USERAGENT PACKAGE_NAME"/"PACKAGE_VERSION #endif -/* Remove GNU specific __attribute__ settings when using another compiler */ -#if !__GNUC__ +/* Only enable __attribute__() for compilers known to support it. */ +#if defined(__clang__) +# define clang_attr(x) __attribute__(x) +# define gcc_attr(x) /**/ +#elif __GNUC__ +# define clang_attr(x) /**/ +# define gcc_attr(x) __attribute__(x) +#else +# define clang_attr(x) /**/ +# define gcc_attr(x) /**/ # define __attribute__(x) /**/ #endif -- 2.11.0