X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/c932d6135ca3e508f7136810b9b0bf79725290b9..a0cd287e64e2d53bc5896e0a7c5ad072cb8bf469:/data/c.m4 diff --git a/data/c.m4 b/data/c.m4 index e0e58cdb..fee006a3 100644 --- a/data/c.m4 +++ b/data/c.m4 @@ -146,16 +146,31 @@ m4_define([b4_table_value_equals], [[YYID (0)]], [[((]$2[) == (]$3[))]])]) + ## ---------## ## Values. ## ## ---------## -# b4_null ---------- -# Return a null pointer constant. NULL infringes on the user name -# space in C, so use 0 rather than NULL. -m4_define([b4_null], [0]) +# b4_null_define +# -------------- +# Portability issues: define a YY_NULL appropriate for the current +# language (C, C++98, or C++11). +m4_define([b4_null_define], +[# ifndef YY_NULL +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULL nullptr +# else +# define YY_NULL 0 +# endif +# endif[]dnl +]) + + +# b4_null +# ------- +# Return a null pointer constant. +m4_define([b4_null], [YY_NULL]) @@ -441,6 +456,8 @@ m4_define_default([b4_yy_symbol_print_generate], b4_locations_if([, [[YYLTYPE const * const yylocationp], [yylocationp]]])[]dnl m4_ifset([b4_parse_param], [, b4_parse_param]))[ { + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; ]b4_locations_if([ YYUSE (yylocationp);