This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [3/4] RFC: introduce gdb_vecs.h
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 20 Jan 2012 15:26:32 +0000
- Subject: Re: [3/4] RFC: introduce gdb_vecs.h
- References: <m3hazrxwur.fsf@fleche.redhat.com>
On 01/19/2012 08:26 PM, Tom Tromey wrote:
> I needed a VEC(char_ptr) in another header for patch #4; but this is a
> pain because it is already defined in tracepoint.h, so there can be
> clashes depending.
>
> This patch introduces gdb_vecs.h and moves the DEF_VEC_P there.
> We could add other vector definitions there as well.
>
> This is a bit of a hack, but I think it is basically the best we can do
> given how vec.h works.
>
> Another possibility here is just including vec.h from defs.h and doing
> the DEF_VEC_P there. I thought I'd pull this patch out separately in
> case anybody prefers that approach, or some other; I can implement it.
This approach is fine with me.
One approach I tried once was to forward declare the VECs in the
headers. It needed a tweak to vec.h. The downside is that we'd
need to DEF_VEC_P (char_ptr) in all modules that wanted to use the
VEC, so I gave up on it.
--
Pedro Alves