From: Akim Demaille Date: Tue, 9 Oct 2012 10:12:52 +0000 (+0200) Subject: maint: more macros X-Git-Tag: v2.6.90~76 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/211c818502252259ed149a28c4c3139249fad990?hp=c12c4c507deebc142ed04a734fdc3579e95d205f maint: more macros * src/output.c (ARRAY_CARDINALITY): Move to... * src/system.h: here. (STREQ, STRNEQ): new. --- diff --git a/src/output.c b/src/output.c index e77a2d1a..a99ef4cd 100644 --- a/src/output.c +++ b/src/output.c @@ -41,8 +41,6 @@ #include "symtab.h" #include "tables.h" -# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) - static struct obstack format_obstack; diff --git a/src/system.h b/src/system.h index bf7f59f9..a8b0f584 100644 --- a/src/system.h +++ b/src/system.h @@ -41,6 +41,10 @@ # include # include +#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array)) +#define STREQ(L, R) (strcmp(L, R) == 0) +#define STRNEQ(L, R) (!STREQ(L, R)) + # ifndef UINTPTR_MAX /* This isn't perfect, but it's good enough for Bison, which needs only to hash pointers. */