hyperic/sigar — pull request #44 by vmx (2014-07-08 13:18:55+00:00)
Title: Don't inline when compiling with Clang

Clang has a different behaviour than GCC when it comes to inlining functions.
Sadly Clang identifies itself as __GNUC__, hence the define to prevent non-GCC
compilers to use the inline keyword didn't work.

This commit solves the problem with adding an additional check to the define,
that the compiler isn't Clang.

During compilation you get warnings like:

In file included from linux_sigar.c:30:
../../../include/sigar_util.h:80:20: warning: inline function 'sigar_skip_token' is not defined
[-Wundefined-inline]
SIGAR_INLINE char *sigar_skip_token(char *p);
^
linux_sigar.c:137:24: note: used here
if ((ptr = sigar_skip_token(ptr))) {
^

Which end up in an error like:

libtool: link: clang -g -O2 -o .libs/cpuinfo cpuinfo.o ../src/.libs/libsigar.so
../src/.libs/libsigar.so: undefined reference to `sigar_skip_token'
clang: error: linker command failed with exit code 1 (use -v to see invocation)