From 211c818502252259ed149a28c4c3139249fad990 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Tue, 9 Oct 2012 12:12:52 +0200 Subject: [PATCH] maint: more macros * src/output.c (ARRAY_CARDINALITY): Move to... * src/system.h: here. (STREQ, STRNEQ): new. --- src/output.c | 2 -- src/system.h | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) 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. */ -- 2.50.0