This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] [1/7] Modernize AIX target: vec.h build fix
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 24 Apr 2007 23:34:45 +0200 (CEST)
- Subject: [rfc] [1/7] Modernize AIX target: vec.h build fix
Hello,
this patch is required to get GDB to build on AIX. The problem is that
AIX system header files define "vec_free", which our vec.h header also
attempts to define.
Strictly speaking, the header files shouldn't define any symbols that
C / POSIX don't require, but they do when building with _ALL_SOURCE,
which we have to do to get at some other stuff.
Thus, I'd suggest to simply rename our definition of vec_free, which
is only used locally in vec.h anyway.
Tested on powerpc-ibm-aix5.3.0.0.
Bye,
Ulrich
ChangeLog:
* vec.h (vec_free): Rename to vec_free_. Adapt users.
diff -urNp gdb-orig/gdb/vec.h gdb-head/gdb/vec.h
--- gdb-orig/gdb/vec.h Wed Apr 18 16:17:12 2007
+++ gdb-head/gdb/vec.h Mon Apr 23 13:51:20 2007
@@ -378,7 +378,7 @@
/* Reallocate an array of elements with prefix. */
extern void *vec_p_reserve (void *, int);
extern void *vec_o_reserve (void *, int, size_t, size_t);
-#define vec_free(V) xfree (V)
+#define vec_free_(V) xfree (V)
#define VEC_ASSERT_INFO ,__FILE__,__LINE__
#define VEC_ASSERT_DECL ,const char *file_,unsigned line_
@@ -458,7 +458,7 @@ static inline void VEC_OP (T,free)
(VEC(T) **vec_) \
{ \
if (*vec_) \
- vec_free (*vec_); \
+ vec_free_ (*vec_); \
*vec_ = NULL; \
} \
\
@@ -696,7 +696,7 @@ static inline void VEC_OP (T,free)
(VEC(T) **vec_) \
{ \
if (*vec_) \
- vec_free (*vec_); \
+ vec_free_ (*vec_); \
*vec_ = NULL; \
} \
\
@@ -954,7 +954,7 @@ static inline void VEC_OP (T,free)
(VEC(T) **vec_) \
{ \
if (*vec_) \
- vec_free (*vec_); \
+ vec_free_ (*vec_); \
*vec_ = NULL; \
} \
\
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com