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: http://review.tizen.org/git/?a=commitdiff_plain;h=211c818502252259ed149a28c4c3139249fad990;p=platform%2Fupstream%2Fbison.git 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 e77a2d1..a99ef4c 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 bf7f59f..a8b0f58 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. */