]> git.draconx.ca Git - cdecl99.git/blobdiff - src/parse.y
cdecl99: Better "help" output on some old systems.
[cdecl99.git] / src / parse.y
index bf2271837758b81634336b614e90963cc789d694..c66a803a9e57d66512d186f9f3aa97f2a6b51464 100644 (file)
  * name strings can be used directly in error messages and there is no
  * need for any string processing.
  */
-#define yytnamerr(a, b) cdecl__strlcpy(a, b, (a) ? INT_MAX : 0)
+#define yytnamerr(a, b) ( (a) ? yytnamerr_copy(a, b) \
+                              : strlen(b) )
+
+static size_t yytnamerr_copy(char *dst, const char *src)
+{
+       return cdecl__strlcpy(dst, src, strlen(src)+1);
+}
 %}
 
 %code requires {
 #include <inttypes.h>
+#include <stdbool.h>
 }
 
 %code provides {
@@ -125,7 +132,7 @@ const char *cdecl__token_name(unsigned token);
 %union {
        uintmax_t uintval;
        unsigned spectype;
-       _Bool boolval;
+       bool boolval;
        struct cdecl_declspec *declspec;
        struct cdecl_declarator *declarator;
        struct cdecl *decl;