Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jan 2003 19:41:48 -0500
From:      Mike Barcroft <mike@FreeBSD.org>
To:        Kyle Martin <mkm@ieee.org>
Cc:        Ryan Younce <ryany@pobox.com>, standards@freebsd.org
Subject:   Re: a few missing types in math.h
Message-ID:  <20030103194148.A79470@espresso.q9media.com>
In-Reply-To: <20021017213133.GE364@marvin.bsdng.org>; from mkm@ieee.org on Thu, Oct 17, 2002 at 04:31:33PM -0500
References:  <20021017213133.GE364@marvin.bsdng.org>

next in thread | previous in thread | raw e-mail | index | archive | help
[Sorry for the very late reply.]

Kyle Martin <mkm@ieee.org> writes:
> double_t and float_t were missing, easy enough:
> 
> Index: math.h
> ===================================================================
> RCS file: /home/ncvs/src/lib/msun/src/math.h,v
> retrieving revision 1.18
> diff -c -r1.18 math.h
> *** math.h	1 Oct 2002 11:44:35 -0000	1.18
> --- math.h	17 Oct 2002 20:56:31 -0000
> ***************
> *** 24,29 ****
> --- 24,35 ----
>   #define HUGE_VAL	(*(double *) __infinity)
>   
>   /*
> +  * C99
> +  */
> + typedef float float_t;
> + typedef double double_t;
> + 
> + /*
>    * XOPEN/SVID
>    */
>   #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)

This needs to at least be conditional on __ISO_C_VISIBLE >= 1999, but I
wonder if we should make these variable types MD.

If we don't want to make them MD, I'd recommend the following patch:

%%%
Index: math.h
===================================================================
RCS file: /work/repo/src/lib/msun/src/math.h,v
retrieving revision 1.20
diff -u -r1.20 math.h
--- math.h	31 Oct 2002 23:05:20 -0000	1.20
+++ math.h	4 Nov 2002 15:25:29 -0000
@@ -17,6 +17,8 @@
 #ifndef _MATH_H_
 #define	_MATH_H_
 
+#include <sys/cdefs.h>
+
 /*
  * ANSI/POSIX
  */
@@ -26,6 +28,12 @@
 } __infinity;
 #define HUGE_VAL	(__infinity.__ud)
 
+#if __ISO_C_VISIBLE >= 1999
+typedef	float	float_t;
+typedef	double	double_t;
+#define	FLT_EVAL_METHOD	0
+#endif
+
 /*
  * XOPEN/SVID
  */
@@ -102,8 +110,6 @@
 
 #endif /* !_XOPEN_SOURCE */
 #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
-
-#include <sys/cdefs.h>
 
 /*
  * Most of these functions have the side effect of setting errno, so they
%%%

Best regards,
Mike Barcroft

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-standards" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030103194148.A79470>