Re: [PATCH 2/3] Consistently use BFD's time

Pedro Alves
2020-01-16T21:58:55Z

On 1/16/20 8:46 PM, Christian Biesinger via gdb-patches wrote:
> On Thu, Jan 16, 2020 at 3:37 PM Pedro Alves <palves@redhat.com> wrote:

>> I think that we need to:
>>
>> - #undef stat before including bfd headers.
>> - Redefine it afterwards back to rpl_stat (*)
>> - add some kind of wrapper around bfd_stat (like maybe called gdb_bfd_stat)
>
> Wouldn't it be easier to #define GNULIB_NAMESPACE in this file? That
> way, the gnulib stuff stays in gnulib:: (or gdb::, or whatever), and
> the global ::stat is the system one.

Good idea. I suspect it's better to do it in an isolated file than
in the whole symfile.c of whatever the problem was found, so that we
don't have to sprinkle the namespace prefix around. I.e., in a file
that only implements gdb_bfd_stat. At least, until have use a namespace
everywhere. We could also poison bfd_stat so that we're sure nothing
in gdb uses it other than the wrapper.

Thanks,
Pedro Alves