This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] rename `ALIGN' to avoid conflict with param.h on BSD systems
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] rename `ALIGN' to avoid conflict with param.h on BSD systems
- From: "David O'Brien" <obrien at FreeBSD dot org>
- Date: Wed, 10 Jan 2001 10:41:42 -0800
- Organization: The NUXI BSD group
- Reply-To: obrien at FreeBSD dot org
2001-01-10 David O'Brien <obrien@FreeBSD.org>
* cpphash.h (ALIGN): Rename to G_ALIGN to avoid conflict on BSD systems.
* cpplex.c: Likewise.
Index: cpphash.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cpphash.h,v
retrieving revision 1.90
diff -u -r1.90 cpphash.h
--- cpphash.h 2000/12/18 19:00:24 1.90
+++ cpphash.h 2001/01/10 18:39:54
@@ -30,14 +30,14 @@
&& CPP_OPTION (pfile, extended_numbers))))
/* Memory pools. */
-#define ALIGN(size, align) (((size) + ((align) - 1)) & ~((align) - 1))
+#define G_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 += G_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/egcs/gcc/cpplex.c,v
retrieving revision 1.125
diff -u -r1.125 cpplex.c
--- cpplex.c 2000/12/17 22:40:32 1.125
+++ cpplex.c 2001/01/10 18:39:54
@@ -1758,7 +1758,7 @@
unsigned char *base;
cpp_chunk *result;
- size = ALIGN (size, DEFAULT_ALIGNMENT);
+ size = G_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. */
@@ -1825,7 +1825,7 @@
cpp_pool *pool;
unsigned int len;
{
- len = ALIGN (len, pool->align);
+ len = G_ALIGN (len, pool->align);
if (len > (unsigned int) POOL_ROOM (pool))
_cpp_next_chunk (pool, len, 0);