This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: Include platform.h in gnu/gcj/runtime/natStackTrace.cc
Tom Tromey writes:
> >>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
>
> Ranjit> This patch makes "gnu/gcj/runtime/natStackTrace.cc" include
> Ranjit> "platform.h" so that, at least on Win32, HAVE_BACKTRACE gets
> Ranjit> defined and the prototype for backtrace( ) gets specified as well.
>
> Andrew> No. This is a configure variable, and should be set in configure.in.
>
> In this case, backtrace() is provided by libgcj.
> I was going to approve this patch.
>
> But I see what you mean: we should just AC_DEFINE HAVE_BACKTRACE in
> configure.in for the appropriate architecture(s).
Precisely. Life is complicated enough without autoconf variables
being set to be one thing in include/config.h and another elsewhere.
For example: say you read your program source and discover that some
code is conditional on HAVE_BACKTRACE, so you look in include/config.h
and discover that variable isn't set. However, it *is* set, whatever
config.h says, just somewhere else. And because you have two
contradictory defintions of HAVE_BACKTRACE the result depends on what
order platform.h and config.h are included. ARgh!
Andrew.