This list is closed, nobody may subscribe to it.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(13) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(38) |
Jul
(10) |
Aug
(70) |
Sep
(63) |
Oct
(61) |
Nov
(41) |
Dec
(28) |
| 2002 |
Jan
(43) |
Feb
(11) |
Mar
(9) |
Apr
(2) |
May
(97) |
Jun
(94) |
Jul
(13) |
Aug
(49) |
Sep
(41) |
Oct
(24) |
Nov
(55) |
Dec
(126) |
| 2003 |
Jan
(90) |
Feb
(75) |
Mar
(32) |
Apr
(24) |
May
(54) |
Jun
(54) |
Jul
(22) |
Aug
(4) |
Sep
(16) |
Oct
(8) |
Nov
(6) |
Dec
(13) |
| 2004 |
Jan
|
Feb
(17) |
Mar
(60) |
Apr
(21) |
May
(12) |
Jun
|
Jul
(13) |
Aug
|
Sep
(29) |
Oct
|
Nov
|
Dec
(2) |
| 2005 |
Jan
(22) |
Feb
(3) |
Mar
(2) |
Apr
(13) |
May
(82) |
Jun
(18) |
Jul
(30) |
Aug
(17) |
Sep
(3) |
Oct
(19) |
Nov
(4) |
Dec
(8) |
| 2006 |
Jan
(1) |
Feb
(6) |
Mar
(2) |
Apr
(40) |
May
|
Jun
(21) |
Jul
(1) |
Aug
(410) |
Sep
(3) |
Oct
|
Nov
(56) |
Dec
(7) |
| 2007 |
Jan
(19) |
Feb
|
Mar
(4) |
Apr
(8) |
May
(19) |
Jun
(6) |
Jul
(4) |
Aug
(6) |
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(2) |
| 2008 |
Jan
(13) |
Feb
(18) |
Mar
(12) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
(2) |
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
(11) |
Oct
(13) |
Nov
(17) |
Dec
(6) |
| 2010 |
Jan
(24) |
Feb
(10) |
Mar
(27) |
Apr
(20) |
May
(108) |
Jun
(8) |
Jul
(23) |
Aug
(38) |
Sep
(49) |
Oct
(17) |
Nov
(12) |
Dec
(14) |
| 2011 |
Jan
(17) |
Feb
(7) |
Mar
(28) |
Apr
(8) |
May
(20) |
Jun
(11) |
Jul
(7) |
Aug
(12) |
Sep
(4) |
Oct
(20) |
Nov
(19) |
Dec
(2) |
| 2012 |
Jan
(2) |
Feb
(6) |
Mar
(5) |
Apr
(24) |
May
(5) |
Jun
(4) |
Jul
(6) |
Aug
(18) |
Sep
(38) |
Oct
(26) |
Nov
(12) |
Dec
(6) |
| 2013 |
Jan
(19) |
Feb
(18) |
Mar
(44) |
Apr
(35) |
May
(18) |
Jun
(21) |
Jul
(10) |
Aug
(19) |
Sep
(44) |
Oct
(25) |
Nov
(1) |
Dec
(2) |
| 2014 |
Jan
(8) |
Feb
|
Mar
|
Apr
(5) |
May
(1) |
Jun
(3) |
Jul
|
Aug
(3) |
Sep
|
Oct
(4) |
Nov
(4) |
Dec
(7) |
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
(4) |
Jul
(6) |
Aug
(2) |
Sep
(8) |
Oct
(2) |
Nov
(1) |
Dec
(3) |
| 2016 |
Jan
(7) |
Feb
(9) |
Mar
(5) |
Apr
(5) |
May
(9) |
Jun
(4) |
Jul
(20) |
Aug
(4) |
Sep
(7) |
Oct
(6) |
Nov
(9) |
Dec
(2) |
| 2017 |
Jan
(7) |
Feb
(7) |
Mar
(5) |
Apr
|
May
(1) |
Jun
(4) |
Jul
(12) |
Aug
(4) |
Sep
(1) |
Oct
(4) |
Nov
(11) |
Dec
(14) |
| 2018 |
Jan
(3) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
|
2
|
3
|
4
|
5
|
6
|
|
7
|
8
(3) |
9
|
10
|
11
|
12
|
13
|
|
14
(1) |
15
|
16
|
17
|
18
|
19
|
20
|
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
|
28
|
29
|
30
|
|
|
|
|
|
From: Keith M. <no...@so...> - 2015-06-14 13:29:29
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Repository: mingw-org-wsl".
The branch, legacy has been updated
via f669eb634b00d53d01a6b12d442ee6cb42a21987 (commit)
via 49761b68725b12ba2f14042b608629d0b97c2fa7 (commit)
from 1f99a789588f8785d6bf69820ff0f5268720fc89 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sf.net/p/mingw/mingw-org-wsl/ci/f669eb634b00d53d01a6b12d442ee6cb42a21987/
commit f669eb634b00d53d01a6b12d442ee6cb42a21987
Author: Keith Marshall <kei...@us...>
Date: Sat Jun 13 08:06:04 2015 +0100
Prefer our hypot() implementation in complex maths operations.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index e631ceb..b9e866e 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,27 @@
+2015-06-13 Keith Marshall <kei...@us...>
+
+ Prefer our hypot() implementation in complex maths operations.
+
+ * mingwex/complex/cabs_generic.c: New file; it replaces...
+ * mingwex/complex/cabs.c mingwex/complex/cabsf.c: ...all of...
+ * mingwex/complex/cabsl.c: ...these.
+
+ * mingwex/complex/catan_generic.c: New file; it replaces...
+ * mingwex/complex/catan.c mingwex/complex/catanf.c: ...all of...
+ * mingwex/complex/catanl.c: ...these.
+
+ * mingwex/complex/clog_generic.c: New file; it replaces...
+ * mingwex/complex/clog.c mingwex/complex/clogf.c: ...all of...
+ * mingwex/complex/clogl.c: ...these.
+
+ * mingwex/complex/cpow_generic.c: New file; it replaces...
+ * mingwex/complex/cpow.c mingwex/complex/cpowf.c: ...all of...
+ * mingwex/complex/cpowl.c: ...these.
+
+ * mingwex/complex/csqrt_generic.c: Do not use...
+ (_hypot): ...this Microsoft form of function reference; use...
+ (hypot): ...this ANSI standard form instead.
+
2015-06-10 Keith Marshall <kei...@us...>
Correct C++ compilation anomaly with hypotf() in cmath header.
diff --git a/mingwrt/mingwex/complex/cabs.c b/mingwrt/mingwex/complex/cabs.c
deleted file mode 100644
index ff547dd..0000000
--- a/mingwrt/mingwex/complex/cabs.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <math.h>
-#include <complex.h>
-
-double cabs (double complex Z)
-{
- return _hypot ( __real__ Z, __imag__ Z);
-}
diff --git a/mingwrt/mingwex/complex/cabs_generic.c b/mingwrt/mingwex/complex/cabs_generic.c
new file mode 100644
index 0000000..fd00027
--- /dev/null
+++ b/mingwrt/mingwex/complex/cabs_generic.c
@@ -0,0 +1,73 @@
+/*
+ * cabs_generic.c
+ *
+ * $Id$
+ *
+ * Compute the modulus of a complex number; this provides a generic
+ * implementation for the cabs(), cabsf(), and cabsl() functions.
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * This is an adaptation of original contributions by Danny Smith
+ * Copyright (C) 2003, 2015, MinGW.org Project
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice, this permission notice, and the following
+ * disclaimer shall be included in all copies or substantial portions of
+ * the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * This is a generic implementation for all of the csqrt(), csqrtl(),
+ * and csqrth() functions; each is to be compiled separately, i.e.
+ *
+ * gcc -D FUNCTION=cabs -o cabs.o cabs_generic.c
+ * gcc -D FUNCTION=cabsl -o cabsl.o cabs_generic.c
+ * gcc -D FUNCTION=cabsf -o cabsf.o cabs_generic.c
+ *
+ */
+#include <math.h>
+#include <complex.h>
+
+#ifndef FUNCTION
+/* If user neglected to specify it, the default compilation is for
+ * the cabs() function.
+ */
+# define FUNCTION cabs
+#endif
+
+#define argtype_cabs double
+#define argtype_cabsl long double
+#define argtype_cabsf float
+
+#define PASTE(PREFIX,SUFFIX) PREFIX##SUFFIX
+#define mapfunc(NAME) mapname(mapfunc_,FUNCTION)(NAME)
+#define mapname(PREFIX,SUFFIX) PASTE(PREFIX,SUFFIX)
+
+#define ARGTYPE(FUNCTION) PASTE(argtype_,FUNCTION)
+
+#define mapfunc_cabs(NAME) NAME
+#define mapfunc_cabsl(NAME) PASTE(NAME,l)
+#define mapfunc_cabsf(NAME) PASTE(NAME,f)
+
+/* Define the generic function implementation.
+ */
+ARGTYPE(FUNCTION) FUNCTION( ARGTYPE(FUNCTION) complex Z )
+{
+ return mapfunc(hypot)( __real__ Z, __imag__ Z );
+}
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/complex/cabsf.c b/mingwrt/mingwex/complex/cabsf.c
deleted file mode 100644
index 452e88f..0000000
--- a/mingwrt/mingwex/complex/cabsf.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <math.h>
-#include <complex.h>
-
-float cabsf (float complex Z)
-{
- return (float) _hypot ( __real__ Z, __imag__ Z);
-}
diff --git a/mingwrt/mingwex/complex/cabsl.c b/mingwrt/mingwex/complex/cabsl.c
deleted file mode 100644
index 3312465..0000000
--- a/mingwrt/mingwex/complex/cabsl.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <math.h>
-#include <complex.h>
-
-long double cabsl (long double complex Z)
-{
- return hypotl ( __real__ Z, __imag__ Z);
-}
diff --git a/mingwrt/mingwex/complex/catan.c b/mingwrt/mingwex/complex/catan.c
deleted file mode 100644
index 94ce34a..0000000
--- a/mingwrt/mingwex/complex/catan.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* catan.c */
-
-/*
- Contributed by Danny Smith
- 2003-10-17
-
- FIXME: This needs some serious numerical analysis.
-*/
-
-#include <math.h>
-#include <complex.h>
-#include <errno.h>
-
-/* catan (z) = -I/2 * clog ((I + z) / (I - z)) */
-
-double complex
-catan (double complex Z)
-{
- double complex Res;
- double complex Tmp;
- double x = __real__ Z;
- double y = __imag__ Z;
-
- if ( x == 0.0 && (1.0 - fabs (y)) == 0.0)
- {
- errno = ERANGE;
- __real__ Res = HUGE_VAL;
- __imag__ Res = HUGE_VAL;
- }
- else if (isinf (_hypot (x, y)))
- {
- __real__ Res = (x > 0 ? M_PI_2 : -M_PI_2);
- __imag__ Res = 0.0;
- }
- else
- {
- __real__ Tmp = - x;
- __imag__ Tmp = 1.0 - y;
-
- __real__ Res = x;
- __imag__ Res = y + 1.0;
-
- Tmp = clog (Res/Tmp);
- __real__ Res = - 0.5 * __imag__ Tmp;
- __imag__ Res = 0.5 * __real__ Tmp;
- }
-
- return Res;
-}
diff --git a/mingwrt/mingwex/complex/catan_generic.c b/mingwrt/mingwex/complex/catan_generic.c
new file mode 100644
index 0000000..2aeb0c3
--- /dev/null
+++ b/mingwrt/mingwex/complex/catan_generic.c
@@ -0,0 +1,134 @@
+/*
+ * catan_generic.c
+ *
+ * $Id$
+ *
+ * Compute the complex arctan corresponding to a complex tangent value;
+ * a generic implementation for catan(), catanf(), and catanl().
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * This is an adaptation of an original contribution by Danny Smith
+ * Copyright (C) 2003-2005, 2015, MinGW.org Project
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice, this permission notice, and the following
+ * disclaimer shall be included in all copies or substantial portions of
+ * the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * This is a generic implementation for all of the catan(), catanl(),
+ * and catanh() functions; each is to be compiled separately, i.e.
+ *
+ * gcc -D FUNCTION=catan -o catan.o catan_generic.c
+ * gcc -D FUNCTION=catanl -o catanl.o catan_generic.c
+ * gcc -D FUNCTION=catanf -o catanf.o catan_generic.c
+ *
+ */
+#include <math.h>
+#include <complex.h>
+
+#ifndef FUNCTION
+/* If user neglected to specify it, the default compilation is for
+ * the catan() function.
+ */
+# define FUNCTION catan
+#endif
+
+#define argtype_catan double
+#define argtype_catanl long double
+#define argtype_catanf float
+
+#define PASTE(PREFIX,SUFFIX) PREFIX##SUFFIX
+#define mapname(PREFIX,SUFFIX) PASTE(PREFIX,SUFFIX)
+
+#define ARGTYPE(FUNCTION) PASTE(argtype_,FUNCTION)
+#define ARGCAST(VALUE) mapname(argcast_,FUNCTION)(VALUE)
+
+#define argcast_catan(VALUE) VALUE
+#define argcast_catanl(VALUE) PASTE(VALUE,L)
+#define argcast_catanf(VALUE) PASTE(VALUE,F)
+
+#define mapfunc(NAME) mapname(mapfunc_,FUNCTION)(NAME)
+
+#define mapfunc_catan(NAME) NAME
+#define mapfunc_catanl(NAME) PASTE(NAME,l)
+#define mapfunc_catanf(NAME) PASTE(NAME,f)
+
+/* Define the generic function implementation.
+ */
+ARGTYPE(FUNCTION) complex FUNCTION( ARGTYPE(FUNCTION) complex Z )
+{
+ ARGTYPE(FUNCTION) x = __real__ Z; /* real part of Z saved as x */
+ ARGTYPE(FUNCTION) y = __imag__ Z; /* imaginary part of Z saved as iy */
+
+ /* Having thus saved the original value of Z as separate real and
+ * imaginary parts, we may reuse Z to accumulate the arctan value,
+ * noting that...
+ */
+ if( isfinite( mapfunc(hypot)( x, y )) )
+ {
+ /* ...for any complex number with finite modulus, its argtan may
+ * be computed as:
+ *
+ * catan(Z) = (clog(1.0 + iZ) - clog(1.0 - iZ)) / 2.0i
+ *
+ * For computational convenience, we may introduce an additional
+ * intermediate accumulator variable...
+ */
+ ARGTYPE(FUNCTION) complex tmp;
+
+ /* ...in which we initially compute the (1.0 - iZ) term...
+ */
+ __real__ tmp = ARGCAST(1.0) + y;
+ __imag__ tmp = -x;
+
+ /* ...while computing (1.0 + iZ) directly in Z itself.
+ */
+ __real__ Z = ARGCAST(1.0) - y;
+ __imag__ Z = x;
+
+ /* We may then compute and combine the complex logarithms
+ * of this pair of sub-expressions, while we simultaneously
+ * perform the REAL division by 2.0...
+ */
+ tmp = ARGCAST(0.5) * (mapfunc(clog)( Z ) - mapfunc(clog)( tmp ));
+
+ /* ...and finally, the division by i has the effect of
+ * exchanging the real and imaginary parts of the result,
+ * with a change of sign in the resultant imaginary part.
+ */
+ __real__ Z = __imag__ tmp;
+ __imag__ Z = -(__real__ tmp);
+ }
+
+ else
+ { /* Conversely, if the modulus of Z is in any way undefined,
+ * we return a real value, with modulus of PI / 2.0, and with
+ * the same sign as the original real part of Z.
+ */
+ __real__ Z = mapfunc(copysign)( ARGCAST(M_PI_2), x );
+ __imag__ Z = ARGCAST(0.0);
+ }
+
+ /* In either case, Z now represents the arctan of its original
+ * value, which we are required to return.
+ */
+ return Z;
+}
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/complex/catanf.c b/mingwrt/mingwex/complex/catanf.c
deleted file mode 100644
index e7f97d4..0000000
--- a/mingwrt/mingwex/complex/catanf.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* catanf.c */
-
-/*
- Contributed by Danny Smith
- 2004-12-24
-
- FIXME: This needs some serious numerical analysis.
-*/
-
-#include <math.h>
-#include <complex.h>
-#include <errno.h>
-
-/* catan (z) = -I/2 * clog ((I + z) / (I - z)) */
-
-float complex
-catanf (float complex Z)
-{
- float complex Res;
- float complex Tmp;
- float x = __real__ Z;
- float y = __imag__ Z;
-
- if ( x == 0.0f && (1.0f - fabsf (y)) == 0.0f)
- {
- errno = ERANGE;
- __real__ Res = HUGE_VALF;
- __imag__ Res = HUGE_VALF;
- }
- else if (isinf (hypotf (x, y)))
- {
- __real__ Res = (x > 0 ? M_PI_2 : -M_PI_2);
- __imag__ Res = 0.0f;
- }
- else
- {
- __real__ Tmp = - x;
- __imag__ Tmp = 1.0f - y;
-
- __real__ Res = x;
- __imag__ Res = y + 1.0f;
-
- Tmp = clogf (Res/Tmp);
- __real__ Res = - 0.5f * __imag__ Tmp;
- __imag__ Res = 0.5f * __real__ Tmp;
- }
-
- return Res;
-}
diff --git a/mingwrt/mingwex/complex/catanl.c b/mingwrt/mingwex/complex/catanl.c
deleted file mode 100644
index 0ada3b3..0000000
--- a/mingwrt/mingwex/complex/catanl.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* catanl.c */
-
-/*
- Contributed by Danny Smith
- 2005-01-04
-
- FIXME: This needs some serious numerical analysis.
-*/
-
-#include <math.h>
-#include <complex.h>
-#include <errno.h>
-
-/* catan (z) = -I/2 * clog ((I + z) / (I - z)) */
-
-#ifndef _M_PI_2L
-#define _M_PI_2L 1.5707963267948966192313L
-#endif
-
-long double complex
-catanl (long double complex Z)
-{
- long double complex Res;
- long double complex Tmp;
- long double x = __real__ Z;
- long double y = __imag__ Z;
-
- if ( x == 0.0L && (1.0L - fabsl (y)) == 0.0L)
- {
- errno = ERANGE;
- __real__ Res = HUGE_VALL;
- __imag__ Res = HUGE_VALL;
- }
- else if (isinf (hypotl (x, y)))
- {
- __real__ Res = (x > 0 ? _M_PI_2L : -_M_PI_2L);
- __imag__ Res = 0.0L;
- }
- else
- {
- __real__ Tmp = - x;
- __imag__ Tmp = 1.0L - y;
-
- __real__ Res = x;
- __imag__ Res = y + 1.0L;
-
- Tmp = clogl (Res/Tmp);
- __real__ Res = - 0.5L * __imag__ Tmp;
- __imag__ Res = 0.5L * __real__ Tmp;
- }
-
- return Res;
-}
diff --git a/mingwrt/mingwex/complex/clog.c b/mingwrt/mingwex/complex/clog.c
deleted file mode 100644
index 57c51eb..0000000
--- a/mingwrt/mingwex/complex/clog.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- clog.c
- Contributed by Danny Smith
- 2003-10-20
-*/
-
-/* clog (x + I * y) = log (hypot (x, y)) + I * atan2 (y, x) */
-
-#include <math.h>
-#include <complex.h>
-
-double complex clog (double complex Z)
-{
- double complex Res;
- __real__ Res = log (_hypot (__real__ Z, __imag__ Z));
- __imag__ Res = carg (Z);
- return Res;
-}
-
diff --git a/mingwrt/mingwex/complex/clog_generic.c b/mingwrt/mingwex/complex/clog_generic.c
new file mode 100644
index 0000000..5d60bf1
--- /dev/null
+++ b/mingwrt/mingwex/complex/clog_generic.c
@@ -0,0 +1,99 @@
+/*
+ * clog_generic.c
+ *
+ * $Id$
+ *
+ * Compute the logarithm of a complex number; this provides a generic
+ * implementation for the clog(), clogf(), and clogl() functions.
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * This is an adaptation of original contributions by Danny Smith
+ * Copyright (C) 2003-2005, 2015, MinGW.org Project
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice, this permission notice, and the following
+ * disclaimer shall be included in all copies or substantial portions of
+ * the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * This is a generic implementation for all of the clog(), clogl(),
+ * and clogf() functions; each is to be compiled separately, i.e.
+ *
+ * gcc -D FUNCTION=clog -o clog.o clog_generic.c
+ * gcc -D FUNCTION=clogl -o clogl.o clog_generic.c
+ * gcc -D FUNCTION=clogf -o clogf.o clog_generic.c
+ *
+ */
+#include <math.h>
+#include <complex.h>
+
+#ifndef FUNCTION
+/* If user neglected to specify it, the default compilation is for
+ * the clog() function.
+ */
+# define FUNCTION clog
+#endif
+
+#define argtype_clog double
+#define argtype_clogl long double
+#define argtype_clogf float
+
+#define PASTE(PREFIX,SUFFIX) PREFIX##SUFFIX
+#define mapname(PREFIX,SUFFIX) PASTE(PREFIX,SUFFIX)
+
+#define ARGTYPE(FUNCTION) PASTE(argtype_,FUNCTION)
+#define ARGCAST(VALUE) mapname(argcast_,FUNCTION)(VALUE)
+
+#define argcast_clog(VALUE) VALUE
+#define argcast_clogl(VALUE) PASTE(VALUE,L)
+#define argcast_clogf(VALUE) PASTE(VALUE,F)
+
+#define mapfunc(NAME) mapname(mapfunc_,FUNCTION)(NAME)
+
+#define mapfunc_clog(NAME) NAME
+#define mapfunc_clogl(NAME) PASTE(NAME,l)
+#define mapfunc_clogf(NAME) PASTE(NAME,f)
+
+/* Prefer the fast version of the log() function.
+ */
+#include "../math/fastmath.h"
+#define log __fast_log
+
+/* Define the generic function implementation.
+ */
+ARGTYPE(FUNCTION) complex FUNCTION( ARGTYPE(FUNCTION) complex Z )
+{
+ /* Compute the value to return; real part is the logarithm of the
+ * modulus of Z, (equivalent to the length of the hypotenuse of the
+ * triangle formed when representing Z by cartesian co-ordinates in
+ * the complex number plane); imaginary part is its phase angle,
+ * (a.k.a. its argument, in the polar representation).
+ *
+ * Note that the applicable POSIX and ISO-C standards do not require
+ * any specific error return, and none is provided; (in particular,
+ * whereas the modulus of Z is ALWAYS >= 0.0, and thus there is no
+ * scope for a log() domain error to occur, modulus of Z == 0.0
+ * causes a log() range error for which errno is NOT set).
+ */
+ ARGTYPE(FUNCTION) complex result;
+ __real__ result = mapfunc(log)( mapfunc(hypot)( __real__ Z, __imag__ Z ) );
+ __imag__ result = mapfunc(carg)( Z );
+ return result;
+}
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/complex/clogf.c b/mingwrt/mingwex/complex/clogf.c
deleted file mode 100644
index ead7602..0000000
--- a/mingwrt/mingwex/complex/clogf.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- clogf.c
- Contributed by Danny Smith
- 2004-12-24
-*/
-
-/* clog (x + I * y) = log (hypot (x, y)) + I * atan2 (y, x) */
-
-#include <math.h>
-#include <complex.h>
-
-float complex clogf (float complex Z)
-{
- float complex Res;
- __real__ Res = logf (_hypot (__real__ Z, __imag__ Z));
- __imag__ Res = cargf (Z);
- return Res;
-}
-
diff --git a/mingwrt/mingwex/complex/clogl.c b/mingwrt/mingwex/complex/clogl.c
deleted file mode 100644
index 0114c91..0000000
--- a/mingwrt/mingwex/complex/clogl.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- clogl.c
- Contributed by Danny Smith
- 2005-01-04
-*/
-
-/* clog (x + I * y) = log (hypot (x, y)) + I * atan2 (y, x) */
-
-#include <math.h>
-#include <complex.h>
-
-long double complex clogl (long double complex Z)
-{
- long double complex Res;
- __real__ Res = logl (hypotl (__real__ Z, __imag__ Z));
- __imag__ Res = cargl (Z);
- return Res;
-}
-
diff --git a/mingwrt/mingwex/complex/cpow.c b/mingwrt/mingwex/complex/cpow.c
deleted file mode 100644
index cbde9f0..0000000
--- a/mingwrt/mingwex/complex/cpow.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* cpow.c */
-/*
- Contributed by Danny Smith
- 2003-10-20
-*/
-
-/* cpow(X, Y) = cexp(X * clog(Y)) */
-
-#include <math.h>
-#include <complex.h>
-
-/* Use dll version of pow */
-extern double (*_imp__pow) (double, double);
-#define pow (*_imp__pow)
-
-double complex cpow (double complex X, double complex Y)
-{
- double complex Res;
- double i;
- double r = hypot (__real__ X, __imag__ X);
- if (r == 0.0)
- {
- __real__ Res = __imag__ Res = 0.0;
- }
- else
- {
- double rho;
- double theta;
- i = carg (X);
- theta = i * __real__ Y;
-
- if (__imag__ Y == 0.0)
- /* This gives slightly more accurate results in these cases. */
- rho = pow (r, __real__ Y);
- else
- {
- r = log (r);
- /* rearrangement of cexp(X * clog(Y)) */
- theta += r * __imag__ Y;
- rho = exp (r * __real__ Y - i * __imag__ Y);
- }
-
- __real__ Res = rho * cos (theta);
- __imag__ Res = rho * sin (theta);
- }
- return Res;
-}
-
diff --git a/mingwrt/mingwex/complex/cpow_generic.c b/mingwrt/mingwex/complex/cpow_generic.c
new file mode 100644
index 0000000..b83ca42
--- /dev/null
+++ b/mingwrt/mingwex/complex/cpow_generic.c
@@ -0,0 +1,128 @@
+/*
+ * cpow_generic.c
+ *
+ * $Id$
+ *
+ * Compute the result of raising a complex number, Z, to a complex
+ * power, N; this provides a generic implementation for each of the
+ * cpow(), cpowf(), and cpowl() functions.
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * This is an adaptation of an original contribution by Danny Smith
+ * Copyright (C) 2003, 2014, MinGW.org Project
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice, this permission notice, and the following
+ * disclaimer shall be included in all copies or substantial portions of
+ * the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * This is a generic implementation for all of the cpow(), cpowl(),
+ * and cpowh() functions; each is to be compiled separately, i.e.
+ *
+ * gcc -D FUNCTION=cpow -o cpow.o cpow_generic.c
+ * gcc -D FUNCTION=cpowl -o cpowl.o cpow_generic.c
+ * gcc -D FUNCTION=cpowf -o cpowf.o cpow_generic.c
+ *
+ */
+#include <math.h>
+#include <complex.h>
+
+#ifndef FUNCTION
+/* If user neglected to specify it, the default compilation is for
+ * the cpow() function.
+ */
+# define FUNCTION cpow
+#endif
+
+#define argtype_cpow double
+#define argtype_cpowl long double
+#define argtype_cpowf float
+
+#define PASTE(PREFIX,SUFFIX) PREFIX##SUFFIX
+#define mapname(PREFIX,SUFFIX) PASTE(PREFIX,SUFFIX)
+
+#define ARGTYPE(FUNCTION) PASTE(argtype_,FUNCTION)
+#define ARGCAST(VALUE) mapname(argcast_,FUNCTION)(VALUE)
+
+#define argcast_cpow(VALUE) VALUE
+#define argcast_cpowl(VALUE) PASTE(VALUE,L)
+#define argcast_cpowf(VALUE) PASTE(VALUE,F)
+
+#define mapfunc(NAME) mapname(mapfunc_,FUNCTION)(NAME)
+
+#define mapfunc_cpow(NAME) NAME
+#define mapfunc_cpowl(NAME) PASTE(NAME,l)
+#define mapfunc_cpowf(NAME) PASTE(NAME,f)
+
+/* Danny Smith's original implementation explicitly referenced the
+ * DLL entry point for the pow() function, in the case of the cpow()
+ * function only; the following variation on mapfunc() reproduces
+ * this implementation model.
+ */
+extern double (*_imp__pow)( double, double );
+#define powfunc mapname(powfunc_,FUNCTION)
+#define powfunc_cpow (*_imp__pow)
+#define powfunc_cpowf powf
+#define powfunc_cpowl powl
+
+/* Define the generic function implementation.
+ */
+ARGTYPE(FUNCTION) complex FUNCTION
+( ARGTYPE(FUNCTION) complex Z, ARGTYPE(FUNCTION) complex N )
+{
+ ARGTYPE(FUNCTION) radius;
+ if( (radius = mapfunc(hypot)( __real__ Z, __imag__ Z )) == ARGCAST(0.0) )
+ /*
+ * Modulus of Z is zero, hence result is also zero; force it.
+ */
+ __real__ Z = __imag__ Z = ARGCAST(0.0);
+
+ else
+ { /* Compute the complex power function result, in terms of its
+ * polar (r, theta) representation in the complex plane.
+ */
+ ARGTYPE(FUNCTION) r = mapfunc(carg)( Z );
+ ARGTYPE(FUNCTION) theta = r * __real__ N;
+
+ if( __imag__ N == ARGCAST(0.0) )
+ /*
+ * For entirely real N, the power function tends to yield
+ * more accuracy than exponential expansion.
+ */
+ r = powfunc( radius, __real__ N );
+
+ else
+ {
+ theta += (radius = mapfunc(log)( radius )) * __imag__ N;
+ r = mapfunc(exp)( radius * __real__ N - r * __imag__ N );
+ }
+
+ /* Convert polar to cartesian representation for return.
+ */
+ __real__ Z = r * mapfunc(cos)( theta );
+ __imag__ Z = r * mapfunc(sin)( theta );
+ }
+
+ /* Regardless of how we got here, the original base value has
+ * now been raised to the specified power; return it.
+ */
+ return Z;
+}
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/complex/cpowf.c b/mingwrt/mingwex/complex/cpowf.c
deleted file mode 100644
index b8a4901..0000000
--- a/mingwrt/mingwex/complex/cpowf.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* cpowf.c */
-/*
- Contributed by Danny Smith
- 2004-12-24
-*/
-
-/* cpow(X, Y) = cexp(X * clog(Y)) */
-
-#include <math.h>
-#include <complex.h>
-
-float complex cpowf (float complex X, float complex Y)
-{
- float complex Res;
- float i;
- float r = _hypot (__real__ X, __imag__ X);
- if (r == 0.0f)
- {
- __real__ Res = __imag__ Res = 0.0;
- }
- else
- {
- float rho;
- float theta;
- i = cargf (X);
- theta = i * __real__ Y;
-
- if (__imag__ Y == 0.0f)
- /* This gives slightly more accurate results in these cases. */
- rho = powf (r, __real__ Y);
- else
- {
- r = logf (r);
- /* rearrangement of cexp(X * clog(Y)) */
- theta += r * __imag__ Y;
- rho = expf (r * __real__ Y - i * __imag__ Y);
- }
-
- __real__ Res = rho * cosf (theta);
- __imag__ Res = rho * sinf (theta);
- }
- return Res;
-}
diff --git a/mingwrt/mingwex/complex/cpowl.c b/mingwrt/mingwex/complex/cpowl.c
deleted file mode 100644
index 59ce1c0..0000000
--- a/mingwrt/mingwex/complex/cpowl.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* cpowl.c */
-/*
- Contributed by Danny Smith
- 2005-01-04
-*/
-
-/* cpow(X, Y) = cexp(X * clog(Y)) */
-
-#include <math.h>
-#include <complex.h>
-
-long double complex cpowl (long double complex X, long double complex Y)
-{
- long double complex Res;
- long double i;
- long double r = hypotl (__real__ X, __imag__ X);
- if (r == 0.0L)
- {
- __real__ Res = __imag__ Res = 0.0L;
- }
- else
- {
- long double rho;
- long double theta;
- i = cargl (X);
- theta = i * __real__ Y;
-
- if (__imag__ Y == 0.0L)
- /* This gives slightly more accurate results in these cases. */
- rho = powl (r, __real__ Y);
- else
- {
- r = logl (r);
- /* rearrangement of cexp(X * clog(Y)) */
- theta += r * __imag__ Y;
- rho = expl (r * __real__ Y - i * __imag__ Y);
- }
-
- __real__ Res = rho * cosl (theta);
- __imag__ Res = rho * sinl (theta);
- }
- return Res;
-}
diff --git a/mingwrt/mingwex/complex/csqrt_generic.c b/mingwrt/mingwex/complex/csqrt_generic.c
index 87ffd83..e68f38d 100644
--- a/mingwrt/mingwex/complex/csqrt_generic.c
+++ b/mingwrt/mingwex/complex/csqrt_generic.c
@@ -3,12 +3,12 @@
*
* $Id$
*
- * Compute the complex arcsin corresponding to a complex sine value;
- * a generic implementation for casin(), casinf(), and casinl().
+ * Compute the principal square root of a complex number; this provides
+ * a generic implementation for csqrt(), csqrtf(), and csqrtl().
*
* Written by Keith Marshall <kei...@us...>
* This is an adaptation of an original contribution by Danny Smith
- * Copyright (C) 2003, 2014, MinGW.org Project
+ * Copyright (C) 2003, 2014, 2015, MinGW.org Project
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -77,14 +77,6 @@
#define log1p __fast_log1p
#define sqrt __fast_sqrt
-/* To compute the modulus of complex numbers, we use the hypot()
- * function, representing it generically by reference to MSVCRT.DLL's
- * double _hypot(); for the float and long double variants, we use
- * our own implementations, which have no leading underscore.
- */
-#define _hypotf hypotf
-#define _hypotl hypotl
-
/* Define the generic function implementation.
*/
ARGTYPE(FUNCTION) complex FUNCTION( ARGTYPE(FUNCTION) complex Z )
@@ -203,11 +195,11 @@ ARGTYPE(FUNCTION) complex FUNCTION( ARGTYPE(FUNCTION) complex Z )
}
else
{ /* Finally, this represents the general complex number case; we
- * may apply (12) and (13) directly, (noting that _hypot(x, y) is
- * functionally equivalent to sqrt(y^2 + x^2), with the advantage
- * that it protects against overflow when x or y is large).
+ * may apply (12) and (13) directly, (noting that hypot(x, y) is
+ * functionally equivalent to sqrt(y^2 + x^2), with the benefit
+ * of protection against overflow when x or y is large).
*/
- __real__ Z = x = mapfunc(sqrt)(ARGCAST(0.5) * (mapfunc(_hypot)(x, y) + x));
+ __real__ Z = x = mapfunc(sqrt)(ARGCAST(0.5) * (mapfunc(hypot)(x, y) + x));
__imag__ Z = ARGCAST(0.5) * y / x;
}
return Z;
https://sf.net/p/mingw/mingw-org-wsl/ci/49761b68725b12ba2f14042b608629d0b97c2fa7/
commit 49761b68725b12ba2f14042b608629d0b97c2fa7
Author: Keith Marshall <kei...@us...>
Date: Fri Jun 12 08:50:00 2015 +0100
Correct C++ compilation anomaly with hypotf() in cmath header.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 8d467c9..e631ceb 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,19 @@
+2015-06-10 Keith Marshall <kei...@us...>
+
+ Correct C++ compilation anomaly with hypotf() in cmath header.
+
+ * include/math.h: Add copyright notice; generally tidy layout.
+ (_BEGIN_C_DECLS, _END_C_DECLS): Use to wrap extern "C" declarations.
+ (hypotf): Delete inline implementation; it did not properly handle
+ range errors, and was uncompilable with optimization when any g++
+ option implying __STRICT_ANSI__ conformity was specified.
+ (_MATH_H_): Rename this multiple inclusion guard...
+ (_MATH_H): ...to this.
+
+ * mingwex/math/hypot_generic.c: New file; it implements...
+ (hypot, hypotf, hypotl): ...these; use the latter pair in place of...
+ * mingwex/math/hypotf.c mingwex/math/hypotl.c: ...these; delete them.
+
2015-06-08 Keith Marshall <kei...@us...>
Prepare and tag all files for release of mingwrt-3.21.1.
@@ -2306,7 +2322,7 @@
2005-02-11 Gregory W. Chicares <chi...@co...>
- * include/math.h (expm1, expm1f, expmll): Add prototypes.
+ * include/math.h (expm1, expm1f, expm1l): Add prototypes.
* mingwex/Makefile.in (MATH_DISTFILES): Add expm1.c,
expm1f.c, expm1l.c.
(MATH_OBJS): Add expm1.o, expm1f.o, expm1l.o.
@@ -3842,7 +3858,7 @@
mingwex/math.
Adjust MATH_OBJS.
Add MATH_DISTFILES and use it to build source distro.
- * include/ math.h: Add protypes for new functions and
+ * include/math.h: Add protypes for new functions and
reorganise to reflect ANSI,C99 status.
2002-06-19 Danny Smith <dan...@us...>
diff --git a/mingwrt/include/math.h b/mingwrt/include/math.h
index 5f5f28e..7f35d71 100644
--- a/mingwrt/include/math.h
+++ b/mingwrt/include/math.h
@@ -1,20 +1,38 @@
/*
* math.h
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within the package.
*
- * Mathematical functions.
+ * ANSI/POSIX + Microsoft compatible mathematical function prototypes,
+ * associated macros, and manifest constant definitions.
+ *
+ * $Id$
+ *
+ * Written by Rob Savoye <ro...@cy...>
+ * Copyright (C) 1997-2009, 2014, 2015, MinGW.org Project.
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice, this permission notice, and the following
+ * disclaimer shall be included in all copies or substantial portions of
+ * the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
+ * DEALINGS IN THE SOFTWARE.
*
*/
-
-
-#ifndef _MATH_H_
-#define _MATH_H_
-
-#if __GNUC__ >= 3
+#ifndef _MATH_H
+#define _MATH_H
#pragma GCC system_header
-#endif
/* All the headers include this file. */
#include <_mingw.h>
@@ -22,7 +40,6 @@
/*
* Types for the _exception structure.
*/
-
#define _DOMAIN 1 /* domain error in argument */
#define _SING 2 /* singularity */
#define _OVERFLOW 3 /* range overflow */
@@ -33,7 +50,6 @@
/*
* Exception types with non-ANSI names for compatibility.
*/
-
#ifndef __STRICT_ANSI__
#ifndef _NO_OLDNAMES
@@ -44,8 +60,8 @@
#define TLOSS _TLOSS
#define PLOSS _PLOSS
-#endif /* Not _NO_OLDNAMES */
-#endif /* Not __STRICT_ANSI__ */
+#endif /* ! _NO_OLDNAMES */
+#endif /* ! __STRICT_ANSI__ */
#if _POSIX_C_SOURCE || defined _USE_MATH_DEFINES
@@ -70,8 +86,12 @@
#define M_SQRT1_2 0.70710678118654752440
#endif
-/* These are also defined in Mingw float.h; needed here as well to work
- around GCC build issues. */
+/* These are also defined in MinGW float.h; needed here as well,
+ * to work around GCC build issues.
+ *
+ * FIXME: Since they're needed both in MinGW float.h and here,
+ * they should be moved to a common "parts" header.
+ */
#ifndef __STRICT_ANSI__
#ifndef __MINGW_FPCLASS_DEFINED
#define __MINGW_FPCLASS_DEFINED 1
@@ -87,16 +107,13 @@
#define _FPCLASS_PN 0x0100 /* Positive Normal */
#define _FPCLASS_PINF 0x0200 /* Positive Infinity */
#endif /* __MINGW_FPCLASS_DEFINED */
-#endif /* Not __STRICT_ANSI__ */
+#endif /* ! __STRICT_ANSI__ */
#ifndef RC_INVOKED
-#ifdef __cplusplus
-extern "C" {
-#endif
+_BEGIN_C_DECLS
-/*
- * HUGE_VAL is returned by strtod when the value would overflow the
+/* HUGE_VAL is returned by strtod when the value would overflow the
* representation of 'double'. There are other uses as well.
*
* __imp__HUGE is a pointer to the actual variable _HUGE in
@@ -105,7 +122,6 @@ extern "C" {
*
* NOTE: The CRTDLL version uses _HUGE_dll instead.
*/
-
#if __MINGW_GNUC_PREREQ(3, 3)
#define HUGE_VAL __builtin_huge_val()
#else
@@ -286,7 +302,7 @@ _CRTIMP int __cdecl fpclass (double);
#define FP_NNORM _FPCLASS_NN
#define FP_PNORM _FPCLASS_PN
-#endif /* Not _NO_OLDNAMES */
+#endif /* ! _NO_OLDNAMES */
/* This require msvcr70.dll or higher. */
#if __MSVCRT_VERSION__ >= 0x0700
@@ -630,10 +646,6 @@ extern long double __cdecl fabsl (long double x);
/* 7.12.7.3 */
extern double __cdecl hypot (double, double); /* in libmoldname.a */
extern float __cdecl hypotf (float, float);
-#ifndef __NO_INLINE__
-__CRT_INLINE float __cdecl hypotf (float x, float y)
-{ return (float)(_hypot (x, y)); }
-#endif
extern long double __cdecl hypotl (long double, long double);
/* 7.12.7.4 The pow functions. Double in C89 */
@@ -817,9 +829,9 @@ extern float __cdecl nanf(const char *tagp);
extern long double __cdecl nanl(const char *tagp);
#ifndef __STRICT_ANSI__
-#define _nan() nan("")
-#define _nanf() nanf("")
-#define _nanl() nanl("")
+#define _nan() nan("")
+#define _nanf() nanf("")
+#define _nanl() nanl("")
#endif
/* 7.12.11.3 */
@@ -860,15 +872,14 @@ extern float __cdecl fmaf (float, float, float);
extern long double __cdecl fmal (long double, long double, long double);
-/* 7.12.14 */
-/*
- * With these functions, comparisons involving quiet NaNs set the FP
- * condition code to "unordered". The IEEE floating-point spec
- * dictates that the result of floating-point comparisons should be
- * false whenever a NaN is involved, with the exception of the != op,
- * which always returns true: yes, (NaN != NaN) is true).
+/* 7.12.14
+ *
+ * With these functions, comparisons involving quiet NaNs set the FP
+ * condition code to "unordered". The IEEE floating-point spec
+ * dictates that the result of floating-point comparisons should be
+ * false whenever a NaN is involved, with the exception of the != op,
+ * which always returns true: yes, (NaN != NaN) is true).
*/
-
#if __GNUC__ >= 3
#define isgreater(x, y) __builtin_isgreater(x, y)
@@ -878,7 +889,7 @@ extern long double __cdecl fmal (long double, long double, long double);
#define islessgreater(x, y) __builtin_islessgreater(x, y)
#define isunordered(x, y) __builtin_isunordered(x, y)
-#else
+#else /* __GNUC__ < 3 */
/* helper */
extern int __cdecl __fp_unordered_compare (long double, long double);
#ifndef __NO_INLINE__
@@ -889,32 +900,20 @@ __fp_unordered_compare (long double x, long double y){
"fnstsw;": "=a" (retval) : "t" (x), "u" (y));
return retval;
}
-#endif
-
-#define isgreater(x, y) ((__fp_unordered_compare(x, y) \
- & 0x4500) == 0)
-#define isless(x, y) ((__fp_unordered_compare (y, x) \
- & 0x4500) == 0)
-#define isgreaterequal(x, y) ((__fp_unordered_compare (x, y) \
- & FP_INFINITE) == 0)
-#define islessequal(x, y) ((__fp_unordered_compare(y, x) \
- & FP_INFINITE) == 0)
-#define islessgreater(x, y) ((__fp_unordered_compare(x, y) \
- & FP_SUBNORMAL) == 0)
-#define isunordered(x, y) ((__fp_unordered_compare(x, y) \
- & 0x4500) == 0x4500)
-
-#endif
+#endif /* ! __NO_INLINE__ */
+#define isgreater(x, y) ((__fp_unordered_compare(x, y) & 0x4500) == 0)
+#define isless(x, y) ((__fp_unordered_compare(y, x) & 0x4500) == 0)
+#define isgreaterequal(x, y) ((__fp_unordered_compare(x, y) & FP_INFINITE) == 0)
+#define islessequal(x, y) ((__fp_unordered_compare(y, x) & FP_INFINITE) == 0)
+#define islessgreater(x, y) ((__fp_unordered_compare(x, y) & FP_SUBNORMAL) == 0)
+#define isunordered(x, y) ((__fp_unordered_compare(x, y) & 0x4500) == 0x4500)
+#endif /* __GNUC__ < 3 */
#endif /* __STDC_VERSION__ >= 199901L */
#endif /* __NO_ISOCEXT */
+_END_C_DECLS
-#ifdef __cplusplus
-}
-#endif
-#endif /* Not RC_INVOKED */
-
-
-#endif /* Not _MATH_H_ */
+#endif /* ! RC_INVOKED */
+#endif /* ! _MATH_H: $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/math/hypot_generic.c b/mingwrt/mingwex/math/hypot_generic.c
new file mode 100644
index 0000000..bb0fd95
--- /dev/null
+++ b/mingwrt/mingwex/math/hypot_generic.c
@@ -0,0 +1,200 @@
+/*
+ * hypot_generic.c
+ *
+ * Compute the length of the hypotenuse of a right triangle, given the
+ * lengths of the two perpendicular sides.
+ *
+ * $Id$
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * Copyright 2015, MinGW.org Project
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ *
+ * This module should be compiled separately for each supported function:
+ *
+ * gcc -D FUNCTION=hypot -o hypot.o hypot_generic.c
+ * gcc -D FUNCTION=hypotl -o hypotl.o hypot_generic.c
+ * gcc -D FUNCTION=hypotf -o hypotf.o hypot_generic.c
+ *
+ */
+#include <math.h>
+#include <float.h>
+#include <errno.h>
+
+#ifndef FUNCTION
+/* If user neglected to specify it, the default compilation is for
+ * the hypot() function.
+ */
+# define FUNCTION hypot
+#endif
+
+#define argtype_hypot double
+#define argtype_hypotl long double
+#define argtype_hypotf float
+
+#define PASTE(PREFIX,SUFFIX) PREFIX##SUFFIX
+#define mapname(PREFIX,SUFFIX) PASTE(PREFIX,SUFFIX)
+
+#define ARGTYPE(FUNCTION) PASTE(argtype_,FUNCTION)
+#define ARGCAST(VALUE) mapname(argcast_,FUNCTION)(VALUE)
+
+#define argcast_hypot(VALUE) VALUE
+#define argcast_hypotl(VALUE) PASTE(VALUE,L)
+#define argcast_hypotf(VALUE) PASTE(VALUE,F)
+
+#define mapfunc(NAME) mapname(mapfunc_,FUNCTION)(NAME)
+
+#define mapfunc_hypot(NAME) NAME
+#define mapfunc_hypotl(NAME) PASTE(NAME,l)
+#define mapfunc_hypotf(NAME) PASTE(NAME,f)
+
+#define hypot_argval_max DBL_MAX
+#define hypotf_argval_max FLT_MAX
+#define hypotl_argval_max LDBL_MAX
+
+#define hypot_result_overflow HUGE_VAL
+#define hypotf_result_overflow HUGE_VALF
+#define hypotl_result_overflow HUGE_VALL
+
+/* Prefer fast version of the sqrt() function.
+ */
+#include "fastmath.h"
+#define sqrt __fast_sqrt
+
+/* Define the generic function implementation.
+ */
+#define METHODL 1
+ARGTYPE(FUNCTION) FUNCTION( ARGTYPE(FUNCTION) x, ARGTYPE(FUNCTION) y )
+{
+# if ARGCAST(METHOD)
+ /*
+ * By default, we implement the actual computation for the
+ * hypotl() function only, (since only METHODL is explicitly
+ * defined as non-zero); to do likewise for the hypot() and
+ * hypotf() functions, compile with -D METHOD and -D METHODF
+ * set respectively.
+ *
+ */
+ if( isfinite(x) && isfinite(y) )
+ {
+ /* For all finite values of x and y, we may compute hypot(x,y)
+ * in terms of their respective magnitudes; we apply Pythagoras'
+ * theorum, but to avoid a possible overflow when computing the
+ * sum of the squares of x and y, we use a transformed variant
+ * of the conventional formula, based on the assumption that
+ * the arguments are ordered such that |x| >= |y|...
+ */
+ ARGTYPE(FUNCTION) h;
+ if( (h = x = mapfunc(fabs)( x )) < (y = mapfunc(fabs)( y )) )
+ {
+ /* ...otherwise, we transpose them.
+ */
+ x = y; y = h;
+ }
+ /* After ensuring that |x| >= |y|, we must perform one more
+ * sanity check to ensure that we don't have |x| == 0.0, (in
+ * which case |y| must also be 0.0, and the quotient |y|/|x|
+ * becomes indeterminate).
+ */
+ if( x == ARGCAST(0.0) )
+ /*
+ * For this specific case, we may avoid the need to compute
+ * the indeterminate quotient, by simple evaluation of the
+ * normal expression of Pythagoras' theorum:
+ *
+ * hypot = sqrt( x * x + y * y )
+ *
+ * directly, to obtain the expected result of zero.
+ */
+ return ARGCAST(0.0);
+
+ /* We can now be confident that the ratio...
+ */
+ h = y / x;
+ /*
+ * ...is determinate, and must lie in the range 0.0 .. 1.0, so
+ * we may safely compute the overflow protected transformation
+ * of the expression of Pythagoras' theorum:
+ *
+ * hypot = x * sqrt( 1.0 + (y / x) * (y / x))
+ *
+ * without any possibility of overflow, when squaring the y / x
+ * ratio term; however, there is still a slight possibility that
+ * x itself is so large that multiplication by the square root
+ * term, (which must lie in the range 1.0 .. sqrt(2.0)), may
+ * cause overflow in the final result...
+ */
+ h = mapfunc(sqrt)( ARGCAST(1.0) + h * h );
+ if( x > (mapname(FUNCTION,_argval_max) / h) )
+ {
+ /* ...in which case, we set errno, and return the appropriate
+ * representation of HUGE_VAL...
+ */
+ errno = ERANGE;
+ return mapname(FUNCTION,_result_overflow);
+ }
+ /* ...otherwise, we may compute and return the requisite result;
+ * we may be certain that this is unaffected by OVERFLOW. On the
+ * other hand, UNDERFLOW may have occurred in the intermediate
+ * computation of y/x; however, the effect is insignificant.
+ */
+ return x * h;
+ }
+ /* If we get to here, one or both of x and y was indefinite; POSIX
+ * requires us to return +inf, if either x or y is infinite, (even
+ * if the other is nan)...
+ */
+ if( isinf( x ) ) return mapfunc(copysign)( x, ARGCAST(+1.0) );
+ if( isinf( y ) ) return mapfunc(copysign)( y, ARGCAST(+1.0) );
+ /*
+ * ...otherwise, combine them to force an indefinite result.
+ */
+ return x + y;
+
+#else
+ /* For the hypot() and hypotf() implementations, we prefer to
+ * compute an intermediate result in the long double domain...
+ */
+ long double intermediate = hypotl( (long double)(x), (long double)(y) );
+
+ /* ...then check that this may be represented within the
+ * effective domain of the return data type...
+ */
+ if( isfinite( intermediate )
+ && (intermediate > (long double)(mapname(FUNCTION,_argval_max))) )
+ {
+ /* ...otherwise flag a RANGE error, and return the
+ * appropriate representation of HUGE_VAL...
+ */
+ errno = ERANGE;
+ return mapname(FUNCTION,_result_overflow);
+ }
+ /* ...or the valid imtermediate result, cast to the
+ * appropriate data type for the function.
+ */
+ return (ARGTYPE(FUNCTION))(intermediate);
+
+#endif
+}
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/math/hypotf.c b/mingwrt/mingwex/math/hypotf.c
deleted file mode 100644
index ee67a45..0000000
--- a/mingwrt/mingwex/math/hypotf.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#include <math.h>
-
-float hypotf (float x, float y)
- { return (float) _hypot (x, y);}
diff --git a/mingwrt/mingwex/math/hypotl.c b/mingwrt/mingwex/math/hypotl.c
deleted file mode 100644
index 5962d1b..0000000
--- a/mingwrt/mingwex/math/hypotl.c
+++ /dev/null
@@ -1,73 +0,0 @@
-#include <math.h>
-#include <float.h>
-#include <errno.h>
-
-/*
-This implementation is based largely on Cephes library
-function cabsl (cmplxl.c), which bears the following notice:
-
-Cephes Math Library Release 2.1: January, 1989
-Copyright 1984, 1987, 1989 by Stephen L. Moshier
-Direct inquiries to 30 Frost Street, Cambridge, MA 02140
-*/
-
-/*
- Modified for use in libmingwex.a
- 02 Sept 2002 Danny Smith <dan...@us...>
- Calls to ldexpl replaced by logbl and calls to frexpl replaced
- by scalbnl to avoid duplicated range checks.
-*/
-
-extern long double __INFL;
-#define PRECL 32
-
-long double
-hypotl (long double x, long double y)
-{
- int exx;
- int eyy;
- int scale;
- long double xx =fabsl(x);
- long double yy =fabsl(y);
- if (!isfinite(xx) || !isfinite(yy))
- return xx + yy; /* Return INF or NAN. */
-
- if (xx == 0.0L)
- return yy;
- if (yy == 0.0L)
- return xx;
-
- /* Get exponents */
- exx = logbl (xx);
- eyy = logbl (yy);
-
- /* Check if large differences in scale */
- scale = exx - eyy;
- if ( scale > PRECL)
- return xx;
- if ( scale < -PRECL)
- return yy;
-
- /* Exponent of approximate geometric mean (x 2) */
- scale = (exx + eyy) >> 1;
-
- /* Rescale: Geometric mean is now about 2 */
- x = scalbnl(xx, -scale);
- y = scalbnl(yy, -scale);
-
- xx = sqrtl(x * x + y * y);
-
- /* Check for overflow and underflow */
- exx = logbl(xx);
- exx += scale;
- if (exx > LDBL_MAX_EXP)
- {
- errno = ERANGE;
- return __INFL;
- }
- if (exx < LDBL_MIN_EXP)
- return 0.0L;
-
- /* Undo scaling */
- return (scalbnl (xx, scale));
-}
-----------------------------------------------------------------------
Summary of changes:
mingwrt/ChangeLog | 44 +++++++-
mingwrt/include/math.h | 127 ++++++++++----------
mingwrt/mingwex/complex/cabs.c | 7 -
mingwrt/mingwex/complex/cabs_generic.c | 73 +++++++++++
mingwrt/mingwex/complex/cabsf.c | 7 -
mingwrt/mingwex/complex/cabsl.c | 7 -
mingwrt/mingwex/complex/catan.c | 49 --------
mingwrt/mingwex/complex/catan_generic.c | 134 +++++++++++++++++++++
mingwrt/mingwex/complex/catanf.c | 49 --------
mingwrt/mingwex/complex/catanl.c | 53 --------
mingwrt/mingwex/complex/clog.c | 19 ---
mingwrt/mingwex/complex/clog_generic.c | 99 +++++++++++++++
mingwrt/mingwex/complex/clogf.c | 19 ---
mingwrt/mingwex/complex/clogl.c | 19 ---
mingwrt/mingwex/complex/cpow.c | 48 --------
mingwrt/mingwex/complex/cpow_generic.c | 128 ++++++++++++++++++++
mingwrt/mingwex/complex/cpowf.c | 43 -------
mingwrt/mingwex/complex/cpowl.c | 43 -------
mingwrt/mingwex/complex/csqrt_generic.c | 22 +---
mingwrt/mingwex/math/hypot_generic.c | 200 +++++++++++++++++++++++++++++++
mingwrt/mingwex/math/hypotf.c | 4 -
mingwrt/mingwex/math/hypotl.c | 73 -----------
22 files changed, 746 insertions(+), 521 deletions(-)
delete mode 100644 mingwrt/mingwex/complex/cabs.c
create mode 100644 mingwrt/mingwex/complex/cabs_generic.c
delete mode 100644 mingwrt/mingwex/complex/cabsf.c
delete mode 100644 mingwrt/mingwex/complex/cabsl.c
delete mode 100644 mingwrt/mingwex/complex/catan.c
create mode 100644 mingwrt/mingwex/complex/catan_generic.c
delete mode 100644 mingwrt/mingwex/complex/catanf.c
delete mode 100644 mingwrt/mingwex/complex/catanl.c
delete mode 100644 mingwrt/mingwex/complex/clog.c
create mode 100644 mingwrt/mingwex/complex/clog_generic.c
delete mode 100644 mingwrt/mingwex/complex/clogf.c
delete mode 100644 mingwrt/mingwex/complex/clogl.c
delete mode 100644 mingwrt/mingwex/complex/cpow.c
create mode 100644 mingwrt/mingwex/complex/cpow_generic.c
delete mode 100644 mingwrt/mingwex/complex/cpowf.c
delete mode 100644 mingwrt/mingwex/complex/cpowl.c
create mode 100644 mingwrt/mingwex/math/hypot_generic.c
delete mode 100644 mingwrt/mingwex/math/hypotf.c
delete mode 100644 mingwrt/mingwex/math/hypotl.c
hooks/post-receive
--
Repository: mingw-org-wsl
|
|
From: Keith M. <no...@so...> - 2015-06-08 14:09:34
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Repository: mingw-org-wsl".
The tag, mingwrt-3.21.1-release has been created
at 0e96011ff8337867928363061febbc7f97b31bfc (commit)
- Log -----------------------------------------------------------------
commit 0e96011ff8337867928363061febbc7f97b31bfc
Author: Keith Marshall <kei...@us...>
Date: Mon Jun 8 12:47:07 2015 +0100
Prepare and tag all files for release of mingwrt-3.21.1.
-----------------------------------------------------------------------
hooks/post-receive
--
Repository: mingw-org-wsl
|
|
From: Keith M. <no...@so...> - 2015-06-08 14:09:32
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Repository: mingw-org-wsl".
The branch, legacy has been updated
via 1f99a789588f8785d6bf69820ff0f5268720fc89 (commit)
via 0e96011ff8337867928363061febbc7f97b31bfc (commit)
from 75741ed73886a6caa5486e09124d66e78a50fb51 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sf.net/p/mingw/mingw-org-wsl/ci/1f99a789588f8785d6bf69820ff0f5268720fc89/
commit 1f99a789588f8785d6bf69820ff0f5268720fc89
Author: Keith Marshall <kei...@us...>
Date: Mon Jun 8 13:19:21 2015 +0100
Added tag mingwrt-3.21.1-release for changeset 283116261e25
diff --git a/.hgtags b/.hgtags
index 290b439..29afce2 100644
--- a/.hgtags
+++ b/.hgtags
@@ -1 +1,2 @@
e6ff0d91cb5027521a314fd0c5eaaedcc7521c19 mingwrt-3.21-release
+283116261e256a65a941ce62e80059843d4d8c51 mingwrt-3.21.1-release
https://sf.net/p/mingw/mingw-org-wsl/ci/0e96011ff8337867928363061febbc7f97b31bfc/
commit 0e96011ff8337867928363061febbc7f97b31bfc
Author: Keith Marshall <kei...@us...>
Date: Mon Jun 8 12:47:07 2015 +0100
Prepare and tag all files for release of mingwrt-3.21.1.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 3993da0..8d467c9 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,11 @@
+2015-06-08 Keith Marshall <kei...@us...>
+
+ Prepare and tag all files for release of mingwrt-3.21.1.
+
+ * configure.ac (AC_INIT): Adjust package version argument.
+ * include/_mingw.h (__MINGW32_PATCHLEVEL): Increment to 1, and...
+ (__MINGW32_VERSION): ...increment this to match.
+
2015-05-18 Keith Marshall <kei...@us...>
Refactor to avoid possible time_t conflicts across headers.
diff --git a/mingwrt/configure.ac b/mingwrt/configure.ac
index b9191d2..a6ba253 100644
--- a/mingwrt/configure.ac
+++ b/mingwrt/configure.ac
@@ -6,7 +6,7 @@
# $Id$
#
# Written by Keith Marshall <kei...@us...>
-# Copyright (C) 2014, MinGW.org Project
+# Copyright (C) 2014, 2015, MinGW.org Project
#
#
# Permission is hereby granted, free of charge, to any person obtaining a
@@ -29,7 +29,7 @@
# DEALINGS IN THE SOFTWARE.
#
AC_PREREQ([2.64])
- AC_INIT([MinGW Runtime],[3.21],[http://mingw.org/Reporting_Bugs],[mingwrt])
+ AC_INIT([MinGW Runtime],[3.21.1],[http://mingw.org/Reporting_Bugs],[mingwrt])
AC_PREFIX_DEFAULT([/mingw])
AC_CONFIG_SRCDIR([include/_mingw.h])
diff --git a/mingwrt/include/_mingw.h b/mingwrt/include/_mingw.h
index c4386e6..e9b2296 100644
--- a/mingwrt/include/_mingw.h
+++ b/mingwrt/include/_mingw.h
@@ -31,10 +31,10 @@
*
* __MINGW32_VERSION = 1,000,000 * major + 1,000 * minor + patch
*/
-#define __MINGW32_VERSION 3021000L
+#define __MINGW32_VERSION 3021001L
#define __MINGW32_MAJOR_VERSION 3
#define __MINGW32_MINOR_VERSION 21
-#define __MINGW32_PATCHLEVEL 0
+#define __MINGW32_PATCHLEVEL 1
#if __GNUC__ >= 3
#ifndef __PCC__
-----------------------------------------------------------------------
Summary of changes:
.hgtags | 1 +
mingwrt/ChangeLog | 8 ++++++++
mingwrt/configure.ac | 4 ++--
mingwrt/include/_mingw.h | 4 ++--
4 files changed, 13 insertions(+), 4 deletions(-)
hooks/post-receive
--
Repository: mingw-org-wsl
|
|
From: Keith M. <no...@so...> - 2015-06-08 05:56:03
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Repository: mingw-org-wsl".
The branch, legacy has been updated
via 75741ed73886a6caa5486e09124d66e78a50fb51 (commit)
via d7b481768ce6b21f7cd3cc849e0c4295846117b4 (commit)
from 815e56ccb4829c9095a264e05f7afcb4f88f8484 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sf.net/p/mingw/mingw-org-wsl/ci/75741ed73886a6caa5486e09124d66e78a50fb51/
commit 75741ed73886a6caa5486e09124d66e78a50fb51
Author: Keith Marshall <kei...@us...>
Date: Mon May 18 13:49:39 2015 +0100
Refactor to avoid possible time_t conflicts across headers.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 0414ca6..3993da0 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,34 @@
+2015-05-18 Keith Marshall <kei...@us...>
+
+ Refactor to avoid possible time_t conflicts across headers.
+
+ * include/parts/time.h (struct timespec): Make it more descriptive of,
+ and better able to accommodate, potential ambiguity relating to...
+ (time_t, __time32_t, __time64_t): ...these typedefs; define them here,
+ whence they may be identically imported into each of...
+ * include/sys/types.h include/time.h include/wchar.h: these; delete
+ duplicate typedefs, and import accordingly.
+
+ * include/sys/types.h: Add licence; general comment additions.
+ (_TYPES_H_): Rename multiple inclusion guard macro...
+ (_SYS_TYPES_H): ...to this.
+
+ * include/time.h: Add licence; general comment/layout adjustments.
+ (_BEGIN_C_DECLS, _END_C_DECLS): Use to wrap extern "C" declarations.
+ (_TIME_T_DEFINED, _TIME32_T_DEFINED, _TIME64_T_DEFINED)
+ (_CLOCK_T_DEFINED): Superfluous guard macros; delete them.
+ (_TIME_H_): Rename multiple inclusion guard macro...
+ (_TIME_H): ...to this.
+
+ * include/unistd.h (nanosleep): Adjust to accommodate redefinition...
+ (struct timespec): ...of this.
+
+ * include/wchar.h: Add licence; general comment/layout adjustments.
+ (_BEGIN_C_DECLS, _END_C_DECLS): Use to wrap extern "C" declarations.
+ [GCC] (system_header): Add pragma, identifying header as such.
+ (_WCHAR_H_): Rename multiple inclusion guard macro...
+ (_WCHAR_H): ...to this.
+
2015-05-09 Keith Marshall <kei...@us...>
Remove obsolete varargs.h header file.
diff --git a/mingwrt/include/parts/time.h b/mingwrt/include/parts/time.h
index 9e19be3..5b94732 100644
--- a/mingwrt/include/parts/time.h
+++ b/mingwrt/include/parts/time.h
@@ -8,7 +8,7 @@
* $Id$
*
* Written by Keith Marshall <kei...@us...>
- * Copyright (C) 2014, MinGW.org Project.
+ * Copyright (C) 2014, 2015, MinGW.org Project.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -48,6 +48,46 @@
# error "Never include <parts/time.h> directly; use <time.h> instead"
#endif
+#if defined __need_time_t || defined __need_struct_timespec
+/*
+ * Wherever this is included, we usually need to define time_t, and
+ * its unambiguously sized variants; don't guard these, as that would
+ * deny the compiler the opportunity to reject inconsistencies, when
+ * defined elsewhere, (although ideally, this file should ALWAYS be
+ * included where these definitions are required; do note, however,
+ * that some compilers, e.g. GCC < 4.x, may reject any attempt to
+ * repeat a typedef, even when it is consistently duplicated; for
+ * such compilers, a conditional guard is necessary).
+ */
+# if __GCC__ >= 4 || ! defined __have_typedef_time_t
+
+ typedef __int32 __time32_t; /* unambiguous 32-bit time_t */
+ typedef __int64 __time64_t; /* unambiguous 64-bit time_t */
+
+# if __MSVCRT_VERSION__ < 0x0800 || defined _USE_32BIT_TIME_T
+ /*
+ * From MSVCR80.DLL onwards, Microsoft have royally messed up the
+ * definition of time_t; maintain POSIX consistency, unless the user
+ * is explicitly using one of these brain damaged DLL variants, and
+ * has not elected to retain the 32-bit time_t representation.
+ */
+ typedef __time32_t time_t;
+
+# else
+ /* Microsoft's brain damaged default, from MSVCR80.DLL onwards.
+ */
+ typedef __time64_t time_t;
+# endif
+# endif
+# if __GCC__ < 4
+ /*
+ * Assume any compiler which is not GCC-4.x or newer may require
+ * guarding against repeated time_t typedefs.
+ */
+# define __have_typedef_time_t 1
+# endif
+#endif
+
#if defined __need_struct_timespec && ! __struct_timespec_defined
/*
* Structure timespec is mandated by POSIX, for specification of
@@ -64,11 +104,19 @@
*/
struct timespec
{
- /* Period is sum of tv_sec + tv_nsec; use fundamental integer types
- * to avoid 32-bit vs. 64-bit time_t ambiguity.
+ /* Period is sum of tv_sec + tv_nsec; use explicitly sized types
+ * to avoid 32-bit vs. 64-bit time_t ambiguity...
*/
- long long tv_sec; /* seconds */
- long tv_nsec; /* nanoseconds */
+ union
+ { /* ...within this anonymous union, allowing tv_sec to accommodate
+ * seconds expressed in either of Microsoft's (ambiguously sized)
+ * time_t representations.
+ */
+ time_t tv_sec; /* ambiguously 32 or 64 bits */
+ __time32_t __tv32_sec; /* unambiguously 32 bits */
+ __time64_t __tv64_sec; /* unambiguously 64 bits */
+ };
+ __int32 tv_nsec; /* nanoseconds */
};
# define __struct_timespec_defined 1
#endif
diff --git a/mingwrt/include/sys/types.h b/mingwrt/include/sys/types.h
index 45da5e6..2113f77 100644
--- a/mingwrt/include/sys/types.h
+++ b/mingwrt/include/sys/types.h
@@ -1,51 +1,53 @@
/*
- * types.h
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within the package.
+ * sys/types.h
*
- * The definition of constants, data types and global variables.
+ * Definitions of (primarily POSIX) system data types.
+ *
+ * $Id$
+ *
+ * Written by Rob Savoye <ro...@cy...>
+ * Copyright (C) 1997-1999, 2001, 2003, 2004, 2008, 2011, 2014-2015,
+ * MinGW.org Project.
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice, this permission notice, and the following
+ * disclaimer shall be included in all copies or substantial portions of
+ * the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
+ * DEALINGS IN THE SOFTWARE.
*
*/
-
-#ifndef _TYPES_H_
-#define _TYPES_H_
+#ifndef _SYS_TYPES_H
+#define _SYS_TYPES_H
+#pragma GCC system_header
/* All the headers include this file. */
#include <_mingw.h>
-#define __need_wchar_t
+#ifndef RC_INVOKED
+
#define __need_size_t
#define __need_ptrdiff_t
-#ifndef RC_INVOKED
+#define __need_wchar_t
#include <stddef.h>
-#endif /* Not RC_INVOKED */
-
-#ifndef RC_INVOKED
-#ifndef _TIME32_T_DEFINED
-typedef __int32 __time32_t;
-#define _TIME32_T_DEFINED
-#endif
+#define __need_time_t
+#define _FAKE_TIME_H_SOURCED 1
+#include <parts/time.h>
-#ifndef _TIME64_T_DEFINED
-typedef __int64 __time64_t;
-#define _TIME64_T_DEFINED
-#endif
-
-#ifndef _TIME_T_DEFINED
-/* FIXME __STRICT_ANSI__ ! */
-#if __MSVCRT_VERSION__ >= 0x0800
-#ifndef _USE_32BIT_TIME_T
-typedef __time64_t time_t;
-#else
-typedef __time32_t time_t;
-#endif /* !_USE_32BIT_TIME_T */
-#else
-typedef __time32_t time_t;
-#endif /* __MSVCRT_VERSION__ >= 0x0800 */
-#define _TIME_T_DEFINED
-#endif
#ifndef _OFF_T_
#define _OFF_T_
@@ -130,9 +132,12 @@ typedef long long off64_t;
#endif
#if _POSIX_C_SOURCE
+/* useconds_t is an obsolete POSIX data type; we continue to define
+ * it here, for backward compatibility, but we flag it as deprecated,
+ * due to its obsolete status.
+ */
typedef unsigned long useconds_t __MINGW_ATTRIB_DEPRECATED;
#endif
-#endif /* Not RC_INVOKED */
-
-#endif /* Not _TYPES_H_ */
+#endif /* ! RC_INVOKED */
+#endif /* ! _SYS_TYPES_H: $RCSfile$: end of file */
diff --git a/mingwrt/include/time.h b/mingwrt/include/time.h
index 4d59db0..6309b1a 100644
--- a/mingwrt/include/time.h
+++ b/mingwrt/include/time.h
@@ -1,76 +1,69 @@
/*
* time.h
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within the package.
*
- * Date and time functions and types.
+ * Type definitions and function declarations relating to date and time.
+ *
+ * $Id$
+ *
+ * Written by Rob Savoye <ro...@cy...>
+ * Copyright (C) 1997-2007, 2011, 2015, MinGW.org Project.
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice, this permission notice, and the following
+ * disclaimer shall be included in all copies or substantial portions of
+ * the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
+ * DEALINGS IN THE SOFTWARE.
*
*/
-
-#ifndef _TIME_H_
-#define _TIME_H_
+#ifndef _TIME_H
+#define _TIME_H
/* All the headers include this file. */
#include <_mingw.h>
-#define __need_wchar_t
-#define __need_size_t
-#define __need_NULL
-#ifndef RC_INVOKED
-#include <stddef.h>
-#endif /* Not RC_INVOKED */
-
-/*
- * Number of clock ticks per second. A clock tick is the unit by which
+/* Number of clock ticks per second. A clock tick is the unit by which
* processor time is measured and is returned by 'clock'.
*/
-#define CLOCKS_PER_SEC ((clock_t)1000)
-#define CLK_TCK CLOCKS_PER_SEC
-
+#define CLOCKS_PER_SEC ((clock_t)(1000))
+#define CLK_TCK CLOCKS_PER_SEC
#ifndef RC_INVOKED
-
/*
- * A type for storing the current time and date. This is the number of
- * seconds since midnight Jan 1, 1970.
- * NOTE: This is also defined in non-ISO sys/types.h.
+ * Some elements declared in time.h may also be required by other
+ * header files, without necessarily including time.h itself; such
+ * elements are declared in the local parts/time.h system header file.
+ * Declarations for such elements must be selected prior to inclusion:
*/
-#ifndef _TIME32_T_DEFINED
-typedef __int32 __time32_t;
-#define _TIME32_T_DEFINED
-#endif
-
-#ifndef __STRICT_ANSI__
-/* A 64-bit time_t to get to Y3K */
-#ifndef _TIME64_T_DEFINED
-typedef __int64 __time64_t;
-#define _TIME64_T_DEFINED
-#endif
-#endif
-
-#ifndef _TIME_T_DEFINED
-/* FIXME __STRICT_ANSI__ ! */
-#if __MSVCRT_VERSION__ >= 0x0800
-#ifndef _USE_32BIT_TIME_T
-typedef __time64_t time_t;
-#else
-typedef __time32_t time_t;
-#endif /* !_USE_32BIT_TIME_T */
-#else
-typedef __time32_t time_t;
-#endif /* __MSVCRT_VERSION__ >= 0x0800 */
-#define _TIME_T_DEFINED
-#endif
+#define __need_time_t
+#define __need_struct_timespec
+#include <parts/time.h>
+/* time.h is also required to duplicate the following type definitions,
+ * which are nominally defined in stddef.h
+ */
+#define __need_NULL
+#define __need_wchar_t
+#define __need_size_t
+#include <stddef.h>
-/*
- * A type for measuring processor time (in clock ticks).
+/* A type for measuring processor time in clock ticks; (no need to
+ * guard this, since it isn't defined elsewhere).
*/
-#ifndef _CLOCK_T_DEFINED
-typedef long clock_t;
-#define _CLOCK_T_DEFINED
-#endif
+typedef long clock_t;
#ifndef _TM_DEFINED
/*
@@ -93,9 +86,7 @@ struct tm
#define _TM_DEFINED
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
+_BEGIN_C_DECLS
_CRTIMP clock_t __cdecl __MINGW_NOTHROW clock (void);
#if __MSVCRT_VERSION__ < 0x0800
@@ -173,9 +164,7 @@ _CRTALIAS struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t* _v) {
#endif /* !_USE_32BIT_TIME_T */
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
-
-/*
- * _daylight: non zero if daylight savings time is used.
+/* _daylight: non zero if daylight savings time is used.
* _timezone: difference in seconds between GMT and local time.
* _tzname: standard/daylight savings time zone names (an array with two
* elements).
@@ -213,35 +202,34 @@ __MINGW_IMPORT char* _tzname[2];
#define _timezone _timezone_dll
#endif /* __DECLSPEC_SUPPORTED */
-
-#endif /* not __MSVCRT__ */
-
-#endif /* Not __STRICT_ANSI__ */
+#endif /* ! __MSVCRT__ */
+#endif /* ! __STRICT_ANSI__ */
#ifndef _NO_OLDNAMES
-
#ifdef __MSVCRT__
-/* These go in the oldnames import library for MSVCRT. */
+/* These go in the oldnames import library for MSVCRT.
+ */
__MINGW_IMPORT int daylight;
__MINGW_IMPORT long timezone;
__MINGW_IMPORT char *tzname[2];
-#else /* not __MSVCRT__ */
-
-/* CRTDLL is royally messed up when it comes to these macros.
- TODO: import and alias these via oldnames import library instead
- of macros. */
-
+#else /* ! __MSVCRT__ */
+/*
+ * CRTDLL is royally messed up when it comes to these macros.
+ * TODO: import and alias these via oldnames import library instead
+ * of macros.
+ */
#define daylight _daylight
-/* NOTE: timezone not defined as macro because it would conflict with
- struct timezone in sys/time.h.
- Also, tzname used to a be macro, but now it's in moldname. */
+/*
+ * NOTE: timezone not defined as a macro because it would conflict with
+ * struct timezone in sys/time.h. Also, tzname used to a be macro, but
+ * now it's in moldname.
+ */
__MINGW_IMPORT char *tzname[2];
-#endif /* not __MSVCRT__ */
-
-#endif /* Not _NO_OLDNAMES */
+#endif /* ! __MSVCRT__ */
+#endif /* ! _NO_OLDNAMES */
#ifndef _WTIME_DEFINED
/* wide function prototypes, also declared in wchar.h */
@@ -270,11 +258,7 @@ _CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_
#define _WTIME_DEFINED
#endif /* _WTIME_DEFINED */
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* Not RC_INVOKED */
-
-#endif /* Not _TIME_H_ */
+_END_C_DECLS
+#endif /* ! RC_INVOKED */
+#endif /* ! _TIME_H: $RCSfile$: end of file */
diff --git a/mingwrt/include/unistd.h b/mingwrt/include/unistd.h
index 6f08690..5e8309d 100644
--- a/mingwrt/include/unistd.h
+++ b/mingwrt/include/unistd.h
@@ -12,7 +12,8 @@
* Ramiro Polla <ra...@li...>
* Gregory McGarry <gre...@us...>
* Keith Marshall <kei...@us...>
- * Copyright (C) 1997, 1999, 2002-2004, 2007-2009, 2014, MinGW.org Project.
+ * Copyright (C) 1997, 1999, 2002-2004, 2007-2009, 2014-2015,
+ * MinGW.org Project.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -90,8 +91,8 @@ int __mingw_sleep( unsigned long, unsigned long );
* with period values normally distributed around means of ~27.5 ms
* and ~7.5 ms, for the two system types respectively.
*/
-#define _FAKE_TIME_H_SOURCED 1
-#define __need_struct_timespec 1
+#define _FAKE_TIME_H_SOURCED 1
+#define __need_struct_timespec
#include <parts/time.h>
_BEGIN_C_DECLS
@@ -109,8 +110,8 @@ __CRT_INLINE __LIBIMPL__(( FUNCTION = nanosleep ))
int nanosleep( const struct timespec *period, struct timespec *residual )
{
if( residual != (void *)(0) )
- residual->tv_sec = (long long)(residual->tv_nsec = 0);
- return __mingw_sleep((unsigned)(period->tv_sec), (period->tv_sec < 0LL)
+ residual->__tv64_sec = (__time64_t)(residual->tv_nsec = 0);
+ return __mingw_sleep((unsigned)(period->__tv64_sec), (period->__tv64_sec < 0LL)
? (unsigned)(-1) : (unsigned)(period->tv_nsec));
}
#endif
diff --git a/mingwrt/include/wchar.h b/mingwrt/include/wchar.h
index 1bc98d4..76b9043 100644
--- a/mingwrt/include/wchar.h
+++ b/mingwrt/include/wchar.h
@@ -1,68 +1,80 @@
/*
* wchar.h
- * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within the package.
*
- * Defines of all functions for supporting wide characters. Actually it
- * just includes all those headers, which is not a good thing to do from a
- * processing time point of view, but it does mean that everything will be
- * in sync.
+ * Declarations relating to support for wide characters; many are simply
+ * inherited by (sub-optimal) inclusion of other header files.
+ *
+ * $Id$
+ *
+ * Written by Rob Savoye <ro...@cy...>
+ * Copyright (C) 1997, 1999-2009, 2011, 2015, MinGW.org Project.
+ *
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice, this permission notice, and the following
+ * disclaimer shall be included in all copies or substantial portions of
+ * the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
+ * DEALINGS IN THE SOFTWARE.
*
*/
-
-#ifndef _WCHAR_H_
-#define _WCHAR_H_
+#ifndef _WCHAR_H
+#define _WCHAR_H
+#pragma GCC system_header
/* All the headers include this file. */
#include <_mingw.h>
-#ifndef RC_INVOKED
-
-#define __need_size_t
-#define __need_wint_t
-#define __need_wchar_t
-#define __need_NULL
-#include <stddef.h>
-
-#ifndef __VALIST
-#if defined __GNUC__ && __GNUC__ >= 3
-#define __need___va_list
-#include <stdarg.h>
-#define __VALIST __builtin_va_list
-#else
-#define __VALIST char*
-#endif
-#endif
-
-#endif /* Not RC_INVOKED */
-
-/*
- * MSDN says that isw* char classifications are in wchar.h and wctype.h.
+/* MSDN says that isw* char classifications are in wchar.h and wctype.h.
* Although the wctype names are ANSI, their exposure in this header is
- * not.
+ * not; nevertheless, we replicate them here, for MSDN conformity.
*/
#include <wctype.h>
-#ifndef __STRICT_ANSI__
-/* This is necessary to support the the non-ANSI wchar declarations
- here. */
-#include <sys/types.h>
+#ifndef __STRICT_ANSI__
+/* This is also necessary, to support the non-ANSI wchar.h declarations
+ * which MSDN identifies as being provided here.
+ */
+# include <sys/types.h>
#endif /* __STRICT_ANSI__ */
#define WCHAR_MIN 0
#define WCHAR_MAX 0xffff
-#ifndef WEOF
-#define WEOF (wchar_t)(0xFFFF)
-#endif
+# define WEOF (wchar_t)(0xffff)
#ifndef RC_INVOKED
-#ifdef __cplusplus
-extern "C" {
+#define __need_size_t
+#define __need_wint_t
+#define __need_wchar_t
+#define __need_NULL
+#include <stddef.h>
+
+#ifndef __VALIST
+# if defined __GNUC__ && __GNUC__ >= 3
+# define __need___va_list
+# include <stdarg.h>
+# define __VALIST __builtin_va_list
+# else
+# define __VALIST char*
+# endif
#endif
+_BEGIN_C_DECLS
+
#ifndef _FILE_DEFINED /* Also in stdio.h */
#define _FILE_DEFINED
typedef struct _iobuf
@@ -78,10 +90,9 @@ typedef struct _iobuf
} FILE;
#endif /* Not _FILE_DEFINED */
-#ifndef _TIME_T_DEFINED /* Also in time.h */
-typedef long time_t;
-#define _TIME_T_DEFINED
-#endif
+#define __need_time_t
+#define _FAKE_TIME_H_SOURCED 1
+#include <parts/time.h>
#ifndef _TM_DEFINED /* Also in time.h */
struct tm {
@@ -635,13 +646,9 @@ _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wspawnvpe (int, const wchar_t*, const
#define _WPROCESS_DEFINED
#endif
-#endif /* not __STRICT_ANSI__ */
-
-#ifdef __cplusplus
-} /* end of extern "C" */
-#endif
-
-#endif /* Not RC_INVOKED */
+#endif /* ! __STRICT_ANSI__ */
-#endif /* not _WCHAR_H_ */
+_END_C_DECLS
+#endif /* ! RC_INVOKED */
+#endif /* ! _WCHAR_H */
https://sf.net/p/mingw/mingw-org-wsl/ci/d7b481768ce6b21f7cd3cc849e0c4295846117b4/
commit d7b481768ce6b21f7cd3cc849e0c4295846117b4
Author: Keith Marshall <kei...@us...>
Date: Sat May 9 11:28:16 2015 +0100
Remove obsolete varargs.h header file.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index f7af073..0414ca6 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,11 @@
+2015-05-09 Keith Marshall <kei...@us...>
+
+ Remove obsolete varargs.h header file.
+
+ * include/varargs.h: Delete it; it was a mostly redundant wrapper for
+ a GCC header which is no longer supported, and was always intended for
+ ultimate removal; now is the long overdue time to do so.
+
2015-05-08 Keith Marshall <kei...@us...>
Correct improper unistd.h function attribute declarations.
diff --git a/mingwrt/include/varargs.h b/mingwrt/include/varargs.h
deleted file mode 100644
index c1197e9..0000000
--- a/mingwrt/include/varargs.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * This is just an RC_INVOKED guard for the real varargs.h
- * fixincluded in gcc system dir. One day we will delete this file.
- */
-#ifndef RC_INVOKED
-#include_next<varargs.h>
-#endif
-----------------------------------------------------------------------
Summary of changes:
mingwrt/ChangeLog | 39 +++++++++++
mingwrt/include/parts/time.h | 58 ++++++++++++++--
mingwrt/include/sys/types.h | 81 ++++++++++++----------
mingwrt/include/time.h | 156 +++++++++++++++++++-----------------------
mingwrt/include/unistd.h | 11 ++--
mingwrt/include/varargs.h | 7 --
mingwrt/include/wchar.h | 115 ++++++++++++++++---------------
7 files changed, 272 insertions(+), 195 deletions(-)
delete mode 100644 mingwrt/include/varargs.h
hooks/post-receive
--
Repository: mingw-org-wsl
|