This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] to gas: portability fix
- To: msokolov at ivan dot Harhan dot ORG
- Subject: Re: [patch] to gas: portability fix
- From: Nick Clifton <nickc at redhat dot com>
- Date: Wed, 13 Dec 2000 10:50:00 -0800
- CC: binutils at sources dot redhat dot com
Hi Michael,
: Below is an obvious portability patch for gas.
:
: Tue Dec 12 22:40:26 PST 2000 Michael Sokolov <msokolov@ivan.Harhan.ORG>
:
: * dwarf2dbg.c: #include <limits.h> only if it exists.
Approved and applied.
There seems to be one problem though - if limits.h is not included
then INT_MAX will not be defined, which will prevent dwarf2dbg.c from
being compiled. I added the following lines to your patch as a
workaround for this potential problem, although I am not sure if this
is the best way to solve the problem:
#ifdef HAVE_LIMITS_H
#include <limits.h>
+ #else
+ #ifndef INT_MAX
+ #define INT_MAX (int) (((unsigned)(-1)) >> 1)
+ #endif
#endif
Cheers
Nick