This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix another possible problem with libgcc-math


This removes the inclusion of sys/param.h which is supposed to drag
in a define for MIN.  Instead provide this in a private header.

Tested on i686-pc-linux-gnu on top of the other patches.

Ok for mainline?

Thanks,
Richard.


2006-02-01  Richard Guenther  <rguenther@suse.de>

	* dbl-64/mpa.c: Do not include sys/param.h.
	* dbl-64/mpa.h (MIN): Define.

Index: dbl-64/mpa.c
===================================================================
*** dbl-64/mpa.c	(revision 110468)
--- dbl-64/mpa.c	(working copy)
***************
*** 47,53 ****
  #include "endian.h"
  #include "mpa.h"
  #include "mpa2.h"
! #include <sys/param.h>	/* For MIN() */
  /* mcr() compares the sizes of the mantissas of two multiple precision  */
  /* numbers. Mantissas are compared regardless of the signs of the       */
  /* numbers, even if x->d[0] or y->d[0] are zero. Exponents are also     */
--- 47,53 ----
  #include "endian.h"
  #include "mpa.h"
  #include "mpa2.h"
! 
  /* mcr() compares the sizes of the mantissas of two multiple precision  */
  /* numbers. Mantissas are compared regardless of the signs of the       */
  /* numbers, even if x->d[0] or y->d[0] are zero. Exponents are also     */
Index: dbl-64/mpa.h
===================================================================
*** dbl-64/mpa.h	(revision 110468)
--- dbl-64/mpa.h	(working copy)
*************** typedef union { int i[2]; double d; } nu
*** 66,71 ****
--- 66,72 ----
  #define  EZ  z->e
  
  #define ABS(x)   ((x) <  0  ? -(x) : (x))
+ #define MIN(a,b) (((a)<(b))?(a):(b))
  
  int __acr(const mp_no *, const mp_no *, int);
  int  __cr(const mp_no *, const mp_no *, int);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]