maint: more macros
authorAkim Demaille <akim@lrde.epita.fr>
Tue, 9 Oct 2012 10:12:52 +0000 (12:12 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Tue, 9 Oct 2012 10:13:09 +0000 (12:13 +0200)
* src/output.c (ARRAY_CARDINALITY): Move to...
* src/system.h: here.
(STREQ, STRNEQ): new.

src/output.c
src/system.h

index e77a2d1..a99ef4c 100644 (file)
@@ -41,8 +41,6 @@
 #include "symtab.h"
 #include "tables.h"
 
-# define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
-
 static struct obstack format_obstack;
 
 
index bf7f59f..a8b0f58 100644 (file)
 # 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.  */