[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] maint: more macros
From: |
Akim Demaille |
Subject: |
[PATCH 1/3] maint: more macros |
Date: |
Tue, 9 Oct 2012 15:16:30 +0200 |
* 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 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 <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. */
--
1.7.12.2