X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcollectd.h;h=6886c123716e8fdb77e176d0edc5f23c4f651fd0;hb=67411e0794cfcab38e322b2ebbe2e5207cbdd86a;hp=5650b59a438b0cfa9629290730959968ab589f4e;hpb=9679723b9f177055ef93d0b1bbb420cca7ac6ea4;p=collectd.git 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