[patch] to gas: portability fix

Nick Clifton nickc@redhat.com
Wed Dec 13 10:50:00 GMT 2000


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


More information about the Binutils mailing list