X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/d0f2b7f8566c186f34392efeedbab08c2ae72129..a17187e56386747a9b4d9633c3d116c2087f2b8b:/src/system.h diff --git a/src/system.h b/src/system.h index a3168db1..f0a76ceb 100644 --- a/src/system.h +++ b/src/system.h @@ -39,6 +39,18 @@ #include #include +#define STREQ(L, R) (strcmp(L, R) == 0) +#define STRNEQ(L, R) (!STREQ(L, R)) + +/* Just like strncmp, but the second argument must be a literal string + and you don't specify the length. */ +#define STRNCMP_LIT(S, Literal) \ + strncmp (S, "" Literal "", sizeof (Literal) - 1) + +/* Whether Literal is a prefix of S. */ +#define STRPREFIX_LIT(Literal, S) \ + (STRNCMP_LIT (S, Literal) == 0) + #if HAVE_SYS_TYPES_H # include #endif @@ -52,7 +64,8 @@ typedef size_t uintptr_t; #endif -#include +// Version mismatch. +#define EX_MISMATCH 63 /*---------. | Gnulib. |