]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Clang;common/config.cc basename() requires libgen.h includes 7787/head
authorWillem Jan Withagen <wjw@digiware.nl>
Wed, 24 Feb 2016 23:39:27 +0000 (00:39 +0100)
committerWillem Jan Withagen <wjw@digiware.nl>
Mon, 9 May 2016 13:49:56 +0000 (15:49 +0200)
But Linux already has it defined in string.h with (const char*) as parameter type.
The including libgen.h confuses matters because the type there is (char*)

So only include libgen.h for FreeBSD

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
src/common/config.cc

index 28067b0607df166aa42e077b8726d49e0b410496..4c66fe77f28550914b3c751e63402f7144dd09c6 100644 (file)
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#if defined(__FreeBSD__)
+/* FreeBSD/Clang requires basename() whereas Linux preffers the version in <string.h> */
+#include <libgen.h>
+#endif
 
 /* Don't use standard Ceph logging in this file.
  * We can't use logging until it's initialized, and a lot of the necessary