lkml.org 
[lkml]   [2009]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateWed, 02 Dec 2009 16:04:19 +0800
FromXiao Guangrong <>
SubjectRe: [PATCH] perf tools: Add _GNU_SOURCE macro for strndup()


Liming Wang wrote:
> strndup is a GNU extension. So add _GNU_SOURCE macro
> to avoid compiling error.
>
> Signed-off-by: Liming Wang <liming.wang@windriver.com>
> Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
> ---
> tools/perf/util/string.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
> index 0977cf4..ea3eb39 100644
> --- a/tools/perf/util/string.c
> +++ b/tools/perf/util/string.c
> @@ -1,5 +1,8 @@
> +#define _GNU_SOURCE
> #include <string.h>
> #include <stdlib.h>
> +
> +#undef _GNU_SOURCE

I think those two "#include" can be removed,
because util.h include it.

> #include "string.h"
> #include "util.h"
>


\
 
 \ /
  Last update: 2009-12-02 09:09    [from the cache]
©2003-2010