tree-wide: whenever we include libgen.h, immediately undefine basename()

Also, document in adjacent comments and in CODING_STYLE why we do that.
This commit is contained in:
Lennart Poettering
2015-02-11 18:50:38 +01:00
parent e89fe484df
commit eef46c372f
4 changed files with 22 additions and 2 deletions
+5
View File
@@ -31,8 +31,13 @@
#include <arpa/inet.h>
#include <net/if.h>
#include <sys/mount.h>
/* When we include libgen.h because we need dirname() we immediately
* undefine basename() since libgen.h defines it as a macro to the XDG
* version which is really broken. */
#include <libgen.h>
#undef basename
#include "sd-bus.h"
#include "log.h"
#include "util.h"