diff options
author | Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp> | 2010-04-04 04:13:18 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-04-04 10:40:42 -0400 |
commit | 8141d0050d76e5695011b5ab577ec66fb51a998c (patch) | |
tree | 9f663a99bea3baa0c6005247494ca3227ba850a9 /tools/perf/util | |
parent | 3326c1ceee234e63160852720d48be8a8f7a6d08 (diff) |
perf: Swap inclusion order of util.h and string.h in util/string.c
Currently util/string.c includes headers in this order: string.h, util.h
But this causes a build error because __USE_GNU definition
is needed for strndup() definition:
% make -j
touch .perf.dev.null
CC util/string.o
cc1: warnings being treated as errors
util/string.c: In function ‘argv_split’:
util/string.c:171: error: implicit declaration of function ‘strndup’
util/string.c:171: error: incompatible implicit declaration of built-in function ‘strndup’
So this patch swaps the headers inclusion order.
util.h defines _GNU_SOURCE, and /usr/include/features.h defines
__USE_GNU as 1 if _GNU_SOURCE is defined.
Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <1270368798-27232-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c index d4389242cfd7..0409fc7c0058 100644 --- a/tools/perf/util/string.c +++ b/tools/perf/util/string.c | |||
@@ -1,5 +1,5 @@ | |||
1 | #include "string.h" | ||
2 | #include "util.h" | 1 | #include "util.h" |
2 | #include "string.h" | ||
3 | 3 | ||
4 | #define K 1024LL | 4 | #define K 1024LL |
5 | /* | 5 | /* |