Skip to contentSkip to conversation

rbtree: fix perf compilation

PATCH Michel Lespinasse 1 participant 1 message Aug 6, 2012 1 message not in the archive Linux-next tree

lore
Share & tools
lore

Michel Lespinasse

author Acked-by
#1 lore raw
In reply to a message not in the archive
Quoted 27 lines · Alexander Shishkin

Commit 2cfaf9cc68190c24fdd05e4d104099b3f27c7a44 (rbtree: adjust root color in rb_insert_color() only when necessary) introduces bool type and constants to the rbtree.c, and breaks compilation of tools/perf:

Quoted 9 lines

../../lib/rbtree.c: In function ‘rb_insert_color’:
../../lib/rbtree.c:95:9: error: ‘true’ undeclared (first use in this function) ../../lib/rbtree.c:95:9: note: each undeclared identifier is reported only once for each function it appears in
../../lib/rbtree.c: In function ‘__rb_erase_color’:
../../lib/rbtree.c:216:9: error: ‘true’ undeclared (first use in this function) ../../lib/rbtree.c: In function ‘rb_erase’:
../../lib/rbtree.c:368:2: error: unknown type name ‘bool’
make: *** [util/rbtree.o] Error 1

This patch is the easiest solution I can think of.

---
 tools/perf/Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/Makefile +0 -0
index 77f124f..2f7a86c 100644

tools/perf/Makefile $(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS · line 808

Quoted 8 lines
tools/perf/Makefile +1 -1
@@ -802,7 +802,7 @@ $(OUTPUT)ui/browsers/map.o: ui/browsers/map.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DENABLE_SLFUTURE_CONST $<
 
 $(OUTPUT)util/rbtree.o: ../../lib/rbtree.c $(OUTPUT)PERF-CFLAGS
-	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' $<
+	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DETC_PERFCONFIG='"$(ETC_PERFCONFIG_SQ)"' -include stdbool.h $<
 
 $(OUTPUT)util/parse-events.o: util/parse-events.c $(OUTPUT)PERF-CFLAGS
 	$(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Wno-redundant-decls $<

Copying Andrew as this probably needs to go through his tree along with the rbtree patches.

Signature · 2 lines
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.