2013-07-08 12:11:56

by Greg Price

[permalink] [raw]
Subject: [PATCH] perf: Avoid missing macros FALSE, TRUE outside ui/gtk/

We use these macros in a few files in ui/gtk/ and they work fine
because GTK includes GLib which defines them, but here in util/
they break the build, at least on my machine. So stick to 0 and 1.

Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Waiman Long <[email protected]>
Cc: Jiri Olsa <[email protected]>
Signed-off-by: Greg Price <[email protected]>
---

This is based on 6d895ece5, which is currently Arnaldo's perf/core.
The offending lines were introduced in 78213177f, committed just the
other day.

Cheers,
Greg

tools/perf/util/dso.c | 2 +-
tools/perf/util/vdso.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 3d80f92..b4c8624 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -531,7 +531,7 @@ struct dso *dsos__find(struct list_head *head, const char *name, bool cmp_short)

struct dso *__dsos__findnew(struct list_head *head, const char *name)
{
- struct dso *dso = dsos__find(head, name, FALSE);
+ struct dso *dso = dsos__find(head, name, 0);

if (!dso) {
dso = dso__new(name);
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index a8fd73d..49edf93 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -91,7 +91,7 @@ void vdso__exit(void)

struct dso *vdso__dso_findnew(struct list_head *head)
{
- struct dso *dso = dsos__find(head, VDSO__MAP_NAME, TRUE);
+ struct dso *dso = dsos__find(head, VDSO__MAP_NAME, 1);

if (!dso) {
char *file;
--
1.8.2


2013-07-08 13:10:59

by Jiri Olsa

[permalink] [raw]
Subject: Re: [PATCH] perf: Avoid missing macros FALSE, TRUE outside ui/gtk/

On Mon, Jul 08, 2013 at 08:11:50AM -0400, Greg Price wrote:
> We use these macros in a few files in ui/gtk/ and they work fine
> because GTK includes GLib which defines them, but here in util/
> they break the build, at least on my machine. So stick to 0 and 1.

and here's another one, pick at your will :))

http://marc.info/?l=linux-kernel&m=137320542616579&w=2

jirka

2013-07-08 13:43:35

by Greg Price

[permalink] [raw]
Subject: Re: [PATCH] perf: Avoid missing macros FALSE, TRUE outside ui/gtk/

On Mon, Jul 08, 2013 at 03:10:52PM +0200, Jiri Olsa wrote:
> On Mon, Jul 08, 2013 at 08:11:50AM -0400, Greg Price wrote:
> > We use these macros in a few files in ui/gtk/ and they work fine
> > because GTK includes GLib which defines them, but here in util/
> > they break the build, at least on my machine. So stick to 0 and 1.
>
> and here's another one, pick at your will :))
>
> http://marc.info/?l=linux-kernel&m=137320542616579&w=2

Ah excellent, that's a better fix, thanks.

Greg