maint: more macros

* src/output.c (ARRAY_CARDINALITY): Move to...
* src/system.h: here.
(STREQ, STRNEQ): new.
This commit is contained in:
Akim Demaille
2012-10-09 12:12:52 +02:00
parent c12c4c507d
commit 211c818502
2 changed files with 4 additions and 2 deletions

View File

@@ -41,8 +41,6 @@
#include "symtab.h"
#include "tables.h"
# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
static struct obstack format_obstack;

View File

@@ -41,6 +41,10 @@
# include <unistd.h>
# include <inttypes.h>
#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. */