lkml.org 
[lkml]   [2020]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 2/3] libperf: avoid redefining _GNU_SOURCE in test
From
_GNU_SOURCE needs to be globally defined to pick up features like
asprintf. Add a guard against redefinition in this test.

Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/lib/perf/tests/test-evlist.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/lib/perf/tests/test-evlist.c b/tools/lib/perf/tests/test-evlist.c
index 6d8ebe0c2504..5a5ff104b668 100644
--- a/tools/lib/perf/tests/test-evlist.c
+++ b/tools/lib/perf/tests/test-evlist.c
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
+#ifndef _GNU_SOURCE
#define _GNU_SOURCE // needed for sched.h to get sched_[gs]etaffinity and CPU_(ZERO,SET)
+#endif
#include <sched.h>
#include <stdio.h>
#include <stdarg.h>
--
2.25.1.481.gfbce0eb801-goog
\
 
 \ /
  Last update: 2020-03-06 08:11    [W:0.155 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site