[PATCH nftables] fix parser.h recursive inclusion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This the recursive parser.h inclusion that happens occasionally when
regenerating the parser files. Amazingly bison, despite its age, is
not using header sandwiches to protect against this *sigh*

Slightly ugly, but fixes the problem.


diff --git a/Makefile.rules.in b/Makefile.rules.in
index 25988dd..ae563a5 100644
--- a/Makefile.rules.in
+++ b/Makefile.rules.in
@@ -22,7 +22,14 @@ configure:		configure.ac
 
 %.c %.h:		%.y	$(makedeps)
 			@echo -e "  YACC\t\t$<"
-			$(YACC) $(YACCFLAGS) -d -o $@ $<
+			$(YACC) $(YACCFLAGS) --defines=$*.h.tmp -o $@ $<
+			( \
+				echo "#ifndef __$(*F)_H"; \
+				echo "#define __$(*F)_H"; \
+				cat $*.h.tmp; \
+				echo "#endif /* __$(*F)_H */" \
+			) > $*.h
+			$(RM) $*.h.tmp
 
 %.c %.h:		%.l	$(makedeps)
 			@echo -e "  LEX\t\t$<"
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux