X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/56f8d560888c22e2788244066478a3e92334f633..6b1cbda1b9e0e8f29c0a6e4e44ce2d5a2aee974f:/data/c.m4 diff --git a/data/c.m4 b/data/c.m4 index 1a527b58..179743c9 100644 --- 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])])])]) ## ---------------- ## @@ -200,7 +202,7 @@ m4_define([b4_table_value_equals], [m4_if(m4_eval($3 < m4_indir([b4_]$1[_min]) || m4_indir([b4_]$1[_max]) < $3), [1], [[0]], - [[((]$2[) == (]$3[))]])]) + [(!!(($2) == ($3)))])]) ## ---------##