]> git.saurik.com Git - bison.git/blobdiff - data/c.m4
build: look for Perl in configure.
[bison.git] / data / c.m4
index 45468e3cac1305dbd5f398f8467978745c13e2d8..fd2203ebbe595688859f109704fd3425f565c6ca 100644 (file)
--- a/data/c.m4
+++ b/data/c.m4
@@ -30,19 +30,21 @@ m4_define([b4_tocpp],
 # ------------------
 # A valid C macro name to use as a CPP header guard for FILE.
 m4_define([b4_cpp_guard],
-[b4_tocpp(m4_defn([b4_prefix])/[$1])])
+[[YY_]b4_tocpp(m4_defn([b4_prefix])/[$1])[_INCLUDED]])
 
 
 # b4_cpp_guard_open(FILE)
 # b4_cpp_guard_close(FILE)
 # ------------------------
-# Open/close CPP inclusion guards for FILE.
+# If FILE does not expand to nothing, open/close CPP inclusion guards for FILE.
 m4_define([b4_cpp_guard_open],
+[m4_ifval(m4_quote($1),
 [#ifndef b4_cpp_guard([$1])
-# define b4_cpp_guard([$1])])
+# define b4_cpp_guard([$1])])])
 
 m4_define([b4_cpp_guard_close],
-[#endif b4_comment([!b4_cpp_guard([$1])])])
+[m4_ifval(m4_quote($1),
+[#endif b4_comment([!b4_cpp_guard([$1])])])])
 
 
 ## ---------------- ##