This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
cpplib: s/ALIGN/_ALIGN
- To: gcc-patches at gcc dot gnu dot org
- Subject: cpplib: s/ALIGN/_ALIGN
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Sat, 3 Feb 2001 17:48:49 +0000
OpenBSD and I believe FreeBSD define a macro ALIGN in param.h.
Unfortunately, it was also a macro used by cpplib.
Neil.
* cpphash.h: Rename ALIGN _ALIGN.
* cpplex.c (new_chunk): Update.
Index: cpphash.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpphash.h,v
retrieving revision 1.94
diff -u -p -r1.94 cpphash.h
--- cpphash.h 2001/02/01 19:13:53 1.94
+++ cpphash.h 2001/02/03 17:46:38
@@ -43,14 +43,14 @@ struct htab;
#define CPP_STACK_MAX 200
/* Memory pools. */
-#define ALIGN(size, align) (((size) + ((align) - 1)) & ~((align) - 1))
+#define _ALIGN(size, align) (((size) + ((align) - 1)) & ~((align) - 1))
#define POOL_FRONT(p) ((p)->cur->front)
#define POOL_LIMIT(p) ((p)->cur->limit)
#define POOL_BASE(p) ((p)->cur->base)
#define POOL_SIZE(p) ((p)->cur->limit - (p)->cur->base)
#define POOL_ROOM(p) ((p)->cur->limit - (p)->cur->front)
#define POOL_USED(p) ((p)->cur->front - (p)->cur->base)
-#define POOL_COMMIT(p, len) do {((p)->cur->front += ALIGN (len, (p)->align));\
+#define POOL_COMMIT(p, len) do {((p)->cur->front += _ALIGN (len, (p)->align));\
if ((p)->cur->front > (p)->cur->limit) abort ();} while (0)
typedef struct cpp_chunk cpp_chunk;
Index: cpplex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cpplex.c,v
retrieving revision 1.127
diff -u -p -r1.127 cpplex.c
--- cpplex.c 2001/02/01 19:13:53 1.127
+++ cpplex.c 2001/02/03 17:46:57
@@ -1759,7 +1759,7 @@ new_chunk (size)
unsigned char *base;
cpp_chunk *result;
- size = ALIGN (size, DEFAULT_ALIGNMENT);
+ size = _ALIGN (size, DEFAULT_ALIGNMENT);
base = (unsigned char *) xmalloc (size + sizeof (cpp_chunk));
/* Put the chunk descriptor at the end. Then chunk overruns will
cause obvious chaos. */