From: Florian Forster Date: Fri, 29 Aug 2014 09:14:31 +0000 (+0200) Subject: src/collectd.h: Enable __attribute__() for clang, too. X-Git-Tag: collectd-5.5.0~217 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d238707db3b54617f84cfd1d20e5fc4a35f64199;p=collectd.git src/collectd.h: Enable __attribute__() for clang, too. --- 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