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
|
9
|
10
|
11
(1) |
12
|
13
(2) |
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
|
21
|
22
|
23
(1) |
24
|
25
|
26
|
27
|
|
28
(3) |
29
|
30
|
31
|
|
|
|
|
From: Keith M. <no...@so...> - 2014-12-28 15:22:20
|
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-dist".
The branch, master has been updated
via 7f86d6f4ad07e2cd78f8b4474df14eb58cd06f89 (commit)
from 5f755e66d0cf598e7ec706e9f87adb7a21062934 (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-dist/ci/7f86d6f4ad07e2cd78f8b4474df14eb58cd06f89/
commit 7f86d6f4ad07e2cd78f8b4474df14eb58cd06f89
Author: Keith Marshall <kei...@us...>
Date: Sun Dec 28 15:21:45 2014 +0000
Upgrade MinGW Runtime package to release mingwrt-3.21
diff --git a/ChangeLog b/ChangeLog
index 81db2bc..d6d85db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,21 @@
+2014-08-26 Keith Marshall <kei...@us...>
+
+ Upgrade MinGW Runtime package to release mingwrt-3.21
+
+ * mingw32/mingw32-runtime.xml: Add new release specifications;
+ withdraw installation support for releases pre-dating mingwrt-3.18.
+ (mingw32-mingwrt) <lic, man>: New sub-packages, separated out from...
+ (mingw32-mingwrt) <dev>: ...here; retrofit virtual equivalents for
+ prior releases, to maintain mingw-get roll-back consistency.
+
+ * mingw32/issue.log common/issue.log: Updated accordingly.
+
2014-10-19 Cesar Strauss <ces...@gm...>
Upgrade msys-bash to GNU Bash 3.1 patchlevel 23.
* msys/msys-bash.xml: Update to 3.1.23-1.
- (msys-bash) <lnk>: New component for creating msys.bat shortcuts.
+ (msys-bash) <lnk>: New component for creating msys.bat shortcuts.
* common/issue.log msys/issue.log: Updated accordingly.
2014-10-19 Cesar Strauss <ces...@gm...>
diff --git a/common/issue.log b/common/issue.log
index a5b25bb..5b98442 100644
--- a/common/issue.log
+++ b/common/issue.log
@@ -23,6 +23,6 @@
# MinGW Project, accept liability for any damages, however caused,
# arising from the use of this software.
#
- 75fc52dde8d408d798c0be51070d5d02f4c63085 2014101900 package-list.xml
+ 75fc52dde8d408d798c0be51070d5d02f4c63085 2014122801 package-list.xml
#
# $RCSfile$: end of file
diff --git a/mingw32/issue.log b/mingw32/issue.log
index 2968fa3..e6525db 100644
--- a/mingw32/issue.log
+++ b/mingw32/issue.log
@@ -50,11 +50,11 @@
cd33ad74b608bce33ea297801253e6efbafce27c 2012073100 mingw32-mingw-utils.xml
3b9dfae51f73761e69811f402c6374c63aeec552 2013110100 mingw32-mpc.xml
8a11de23e7a89fd11436bdf162ef90712f30101b 2013102300 mingw32-mpfr.xml
- 1413ad59660ad963082e7de10c31bbb725116aee 2014100700 mingw32-package-list.xml
+ 1413ad59660ad963082e7de10c31bbb725116aee 2014122800 mingw32-package-list.xml
bad22da9b9ec9bcea1d539e29ee2976cc88d9fc2 2013053000 mingw32-pexports.xml
cdb2a4dbedfc9f2cdfc92340f6f9b12da061c0d9 2012073100 mingw32-popt.xml
0a5d210a13d073104fb74b4f9c081674c9745cd1 2013090900 mingw32-pthreads-w32.xml
- 428964289b3509293a13c9394199b5e2d4887c3e 2014082600 mingw32-runtime.xml
+ 68b3d00fc0dd2e7ae7ea22cbbc154a34c7618614 2014122800 mingw32-runtime.xml
12acb32f80e49c893167cfae82e448dd766d49bb 2013070100 mingw32-wsl-candidate.xml
247a02890f109a5fe4996fde4af9d576dca3cd1e 2012073100 mingw32-xz.xml
c223ecd7389eb02948b54f8959d595cf608306a7 2013101200 mingw32-zlib.xml
diff --git a/mingw32/mingw32-runtime.xml b/mingw32/mingw32-runtime.xml
index 59a92d3..70dc46e 100644
--- a/mingw32/mingw32-runtime.xml
+++ b/mingw32/mingw32-runtime.xml
@@ -25,23 +25,75 @@
</description>
<source tarname="mingwrt-%-mingw32-src.tar.%" />
- <licence tarname="mingwrt-%-mingw32-dev.tar.%" />
+ <licence tarname="mingwrt-%-mingw32-lic.tar.%" />
<component class="dev">
<requires eq="mingwrt-%-mingw32-dll.tar" />
- <release tarname="mingwrt-3.20-2-mingw32-dev.tar.lzma" />
- <release tarname="mingwrt-3.20-mingw32-dev.tar.gz" />
- <release tarname="mingwrt-3.19-mingw32-dev.tar.gz" />
- <release tarname="mingwrt-3.18-mingw32-dev.tar.gz" />
- <release tarname="mingwrt-3.17-mingw32-dev.tar.gz" />
+ <release tarname="mingwrt-3.21-mingw32-dev.tar.xz" />
+ <release tarname="mingwrt-3.20-2-mingw32-dev.tar.lzma">
+ <requires eq="mingwrt-%-mingw32-lic.tar" />
+ <requires eq="mingwrt-%-mingw32-man.tar" />
+ </release>
+ <release tarname="mingwrt-3.20-mingw32-dev.tar.gz">
+ <requires eq="mingwrt-%-mingw32-lic.tar" />
+ <requires eq="mingwrt-%-mingw32-man.tar" />
+ </release>
+ <release tarname="mingwrt-3.19-mingw32-dev.tar.gz">
+ <requires eq="mingwrt-%-mingw32-lic.tar" />
+ <requires eq="mingwrt-%-mingw32-man.tar" />
+ </release>
+ <release tarname="mingwrt-3.18-mingw32-dev.tar.gz">
+ <requires eq="mingwrt-%-mingw32-lic.tar" />
+ <requires eq="mingwrt-%-mingw32-man.tar" />
+ </release>
</component>
<component class="dll">
+ <release tarname="mingwrt-3.21-mingw32-dll.tar.xz" />
<release tarname="mingwrt-3.20-2-mingw32-dll.tar.lzma" />
<release tarname="mingwrt-3.20-mingw32-dll.tar.gz" />
<release tarname="mingwrt-3.19-mingw32-dll.tar.gz" />
<release tarname="mingwrt-3.18-mingw32-dll.tar.gz" />
- <release tarname="mingwrt-3.17-mingw32-dll.tar.gz" />
+ </component>
+
+ <component class="lic">
+ <release tarname="mingwrt-3.21-mingw32-lic.tar.xz" />
+ <release tarname="mingwrt-3.20-2-mingw32-lic.tar.lzma">
+ <requires eq="mingwrt-%-mingw32-dev.tar" />
+ <download tarname="none" />
+ </release>
+ <release tarname="mingwrt-3.20-mingw32-lic.tar.gz">
+ <requires eq="mingwrt-%-mingw32-dev.tar" />
+ <download tarname="none" />
+ </release>
+ <release tarname="mingwrt-3.19-mingw32-lic.tar.gz">
+ <requires eq="mingwrt-%-mingw32-dev.tar" />
+ <download tarname="none" />
+ </release>
+ <release tarname="mingwrt-3.18-mingw32-lic.tar.gz">
+ <requires eq="mingwrt-%-mingw32-dev.tar" />
+ <download tarname="none" />
+ </release>
+ </component>
+
+ <component class="man">
+ <release tarname="mingwrt-3.21-mingw32-man.tar.xz" />
+ <release tarname="mingwrt-3.20-2-mingw32-man.tar.lzma">
+ <requires eq="mingwrt-%-mingw32-dev.tar" />
+ <download tarname="none" />
+ </release>
+ <release tarname="mingwrt-3.20-mingw32-man.tar.gz">
+ <requires eq="mingwrt-%-mingw32-dev.tar" />
+ <download tarname="none" />
+ </release>
+ <release tarname="mingwrt-3.19-mingw32-man.tar.gz">
+ <requires eq="mingwrt-%-mingw32-dev.tar" />
+ <download tarname="none" />
+ </release>
+ <release tarname="mingwrt-3.18-mingw32-man.tar.gz">
+ <requires eq="mingwrt-%-mingw32-dev.tar" />
+ <download tarname="none" />
+ </release>
</component>
</package>
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 14 ++++++++-
common/issue.log | 2 +-
mingw32/issue.log | 4 +-
mingw32/mingw32-runtime.xml | 66 ++++++++++++++++++++++++++++++++++++++----
4 files changed, 75 insertions(+), 11 deletions(-)
hooks/post-receive
--
Repository: mingw-dist
|
|
From: Keith M. <no...@so...> - 2014-12-28 14:27:47
|
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-release has been created
at 04cbd1f5760fd9b5b4cb0b13df59390089067851 (commit)
- Log -----------------------------------------------------------------
commit 04cbd1f5760fd9b5b4cb0b13df59390089067851
Author: Keith Marshall <kei...@us...>
Date: Sun Dec 28 14:25:09 2014 +0000
Tag all files for release of mingwrt-3.21.
-----------------------------------------------------------------------
hooks/post-receive
--
Repository: mingw-org-wsl
|
|
From: Keith M. <no...@so...> - 2014-12-28 14:27:45
|
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 fdb8a54a985a52c3c0d7f63d91769bf28eaa37c3 (commit)
via 04cbd1f5760fd9b5b4cb0b13df59390089067851 (commit)
via 487dd058c6a3014dfa6856a9a6fe79aab04ccef7 (commit)
from 4b6f8bf12337d27faed244ebb34da6e96a6b86e1 (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/fdb8a54a985a52c3c0d7f63d91769bf28eaa37c3/
commit fdb8a54a985a52c3c0d7f63d91769bf28eaa37c3
Author: Keith Marshall <kei...@us...>
Date: Sun Dec 28 14:25:49 2014 +0000
Added tag mingwrt-3.21-release for changeset e6ff0d91cb50
diff --git a/.hgtags b/.hgtags
new file mode 100644
index 0000000..290b439
--- /dev/null
+++ b/.hgtags
@@ -0,0 +1 @@
+e6ff0d91cb5027521a314fd0c5eaaedcc7521c19 mingwrt-3.21-release
https://sf.net/p/mingw/mingw-org-wsl/ci/04cbd1f5760fd9b5b4cb0b13df59390089067851/
commit 04cbd1f5760fd9b5b4cb0b13df59390089067851
Author: Keith Marshall <kei...@us...>
Date: Sun Dec 28 14:25:09 2014 +0000
Tag all files for release of mingwrt-3.21.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 2f1c306..ff5f2d6 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,11 @@
2014-12-28 Keith Marshall <kei...@us...>
+ Tag all files for release of mingwrt-3.21.
+
+ * include/_mingw.h: Adjust version accordingly.
+
+2014-12-28 Keith Marshall <kei...@us...>
+
Improve usage notes in stdlib.h, for mkstemp() function.
* include/stdlib.h (MKSTEMP_SETMODE): Explain usage; this is a copy of
diff --git a/mingwrt/include/_mingw.h b/mingwrt/include/_mingw.h
index 8d50363..c4386e6 100644
--- a/mingwrt/include/_mingw.h
+++ b/mingwrt/include/_mingw.h
@@ -22,10 +22,19 @@
*/
#define __MINGW_H
-#define __MINGW32_VERSION 3.20
-#define __MINGW32_MAJOR_VERSION 3
-#define __MINGW32_MINOR_VERSION 20
-#define __MINGW32_PATCHLEVEL 0
+/* In previous versions, __MINGW32_VERSION was expressed as a dotted
+ * numeric pair, representing major.minor; unfortunately, this doesn't
+ * adapt well to the inclusion of a patch-level component, since the
+ * major.minor.patch dotted triplet representation is not valid as a
+ * numeric entity. Thus, for this version, we adopt a representation
+ * which encodes the version as a long integer value, expressing:
+ *
+ * __MINGW32_VERSION = 1,000,000 * major + 1,000 * minor + patch
+ */
+#define __MINGW32_VERSION 3021000L
+#define __MINGW32_MAJOR_VERSION 3
+#define __MINGW32_MINOR_VERSION 21
+#define __MINGW32_PATCHLEVEL 0
#if __GNUC__ >= 3
#ifndef __PCC__
https://sf.net/p/mingw/mingw-org-wsl/ci/487dd058c6a3014dfa6856a9a6fe79aab04ccef7/
commit 487dd058c6a3014dfa6856a9a6fe79aab04ccef7
Author: Keith Marshall <kei...@us...>
Date: Sun Dec 28 12:44:49 2014 +0000
Improve usage notes in stdlib.h, for mkstemp() function.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 31dcb14..2f1c306 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,11 @@
+2014-12-28 Keith Marshall <kei...@us...>
+
+ Improve usage notes in stdlib.h, for mkstemp() function.
+
+ * include/stdlib.h (MKSTEMP_SETMODE): Explain usage; this is a copy of
+ an original comment, explaining the need to use _O_TEMPORARY, from...
+ * mingwex/mkstemp.c: ...here; delete trailing white space.
+
2014-12-23 Keith Marshall <kei...@us...>
Eliminate some potential definition inconsistencies.
diff --git a/mingwrt/include/stdlib.h b/mingwrt/include/stdlib.h
index 516f636..cc705b5 100644
--- a/mingwrt/include/stdlib.h
+++ b/mingwrt/include/stdlib.h
@@ -567,11 +567,36 @@ wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, in
int __cdecl __MINGW_NOTHROW mkstemp( char * );
int __cdecl __MINGW_NOTHROW __mingw_mkstemp( int, char * );
-/* The following macros are a MinGW specific extension, to facilite
+/* On POSIX platforms, programmers may adopt an idiom such as:
+ *
+ * if( mkstemp( template ) >= 0 )
+ * { unlink( template );
+ * . . .
+ * }
+ *
+ * to ensure that a temporary file does NOT persist after it is
+ * closed; MS-Windows does not allow such use of unlink(2), while
+ * the file remains open. Thus, MS-Windows programmers must take
+ * extra care, to close and unlink temporary files AFTER use, if
+ * similar behaviour is desired.
+ *
+ * To mitigate this MS-Windows limitation, we provide support for
+ * an alternative, MinGW specific idiom:
+ *
+ * #include <fcntl.h>
+ *
+ * _MKSTEMP_SETMODE( _O_TEMPORARY );
+ * if( mkstemp( template ) >= 0 )
+ * {
+ * . . .
+ * }
+ *
+ * to achieve a similar effect to that of the above POSIX idiom; the
+ * following macros are a MinGW specific extension, to facilite such
* use of _O_TEMPORARY, (in addition to the POSIX required attributes),
* when creating the temporary file. Note that they require fcntl.h,
* which stdlib.h should NOT automatically include; we leave the onus
- * on the user to explicitly include it, if using MKSTEMP_SETMODE.
+ * on the user to explicitly include it, if using _MKSTEMP_SETMODE.
*/
#define _MKSTEMP_INVOKE 0
#define _MKSTEMP_DEFAULT _O_CREAT | _O_EXCL | _O_RDWR
diff --git a/mingwrt/mingwex/mkstemp.c b/mingwrt/mingwex/mkstemp.c
index b71c302..6f2685e 100644
--- a/mingwrt/mingwex/mkstemp.c
+++ b/mingwrt/mingwex/mkstemp.c
@@ -79,7 +79,7 @@ int __mingw_mkstemp( int setmode, char *template )
* _MKSTEMP_SETMODE( _O_TEMPORARY );
* if( mkstemp( template ) >= 0 )
* {
- * . . .
+ * . . .
* }
*
* to achieve a similar effect to that of the above POSIX idiom.
-----------------------------------------------------------------------
Summary of changes:
.hgtags | 1 +
mingwrt/ChangeLog | 14 ++++++++++++++
mingwrt/include/_mingw.h | 17 +++++++++++++----
mingwrt/include/stdlib.h | 29 +++++++++++++++++++++++++++--
mingwrt/mingwex/mkstemp.c | 2 +-
5 files changed, 56 insertions(+), 7 deletions(-)
create mode 100644 .hgtags
hooks/post-receive
--
Repository: mingw-org-wsl
|
|
From: Keith M. <no...@so...> - 2014-12-23 21:41:07
|
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 4b6f8bf12337d27faed244ebb34da6e96a6b86e1 (commit)
via 10f0861737bedd7691375d300bcb57a26c9e0384 (commit)
via b83d2b297de77aece4b2b37855c69be2431f060b (commit)
from f3ab46526f1432c60d012f68783374375897760c (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/4b6f8bf12337d27faed244ebb34da6e96a6b86e1/
commit 4b6f8bf12337d27faed244ebb34da6e96a6b86e1
Author: Keith Marshall <kei...@us...>
Date: Tue Dec 23 21:40:16 2014 +0000
Eliminate some potential definition inconsistencies.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index d4d0a8c..31dcb14 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,14 @@
2014-12-23 Keith Marshall <kei...@us...>
+ Eliminate some potential definition inconsistencies.
+
+ * include/stdio.h: Cosmetic formatting change, relating to...
+ * include/unistd.h (SEEK_SET, SEEK_CUR, SEEK_END): Define them
+ unconditionally; this allows the compiler to check for consistency
+ with their primary definitions in stdio.h
+
+2014-12-23 Keith Marshall <kei...@us...>
+
Suppress expected warning diagnostics in LIBIMPL builds.
* Makefile.in (LIBIMPL_CFLAGS): Redefine it; it now incorporates...
diff --git a/mingwrt/include/stdio.h b/mingwrt/include/stdio.h
index 1248081..02fb4df 100644
--- a/mingwrt/include/stdio.h
+++ b/mingwrt/include/stdio.h
@@ -102,10 +102,11 @@
/* Constants for nOrigin indicating the position relative to which fseek
* sets the file position. Defined unconditionally since ISO and POSIX
- * say they are defined here. */
-#define SEEK_SET 0
-#define SEEK_CUR 1
-#define SEEK_END 2
+ * say they are defined here.
+ */
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
#ifndef RC_INVOKED
diff --git a/mingwrt/include/unistd.h b/mingwrt/include/unistd.h
index b6bd05e..26df7ba 100644
--- a/mingwrt/include/unistd.h
+++ b/mingwrt/include/unistd.h
@@ -53,18 +53,13 @@
#include <process.h>
#include <getopt.h>
-/* These are also defined in stdio.h. */
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
-#ifndef SEEK_CUR
-#define SEEK_CUR 1
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END 2
-#endif
+/* These are defined in stdio.h. POSIX also requires that they
+ * are to be consistently defined here; don't guard against prior
+ * definitions, as this might conceal inconsistencies.
+ */
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
#if _POSIX_C_SOURCE
/*
https://sf.net/p/mingw/mingw-org-wsl/ci/10f0861737bedd7691375d300bcb57a26c9e0384/
commit 10f0861737bedd7691375d300bcb57a26c9e0384
Author: Keith Marshall <kei...@us...>
Date: Tue Dec 23 21:11:58 2014 +0000
Suppress expected warning diagnostics in LIBIMPL builds.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 8666b9f..d4d0a8c 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,13 @@
2014-12-23 Keith Marshall <kei...@us...>
+ Suppress expected warning diagnostics in LIBIMPL builds.
+
+ * Makefile.in (LIBIMPL_CFLAGS): Redefine it; it now incorporates...
+ (LIBIMPL_EXTRA_CFLAGS): ...this new macro; it includes the requisite
+ GCC flag to supress warnings relating to deprecated declarations.
+
+2014-12-23 Keith Marshall <kei...@us...>
+
Provide more POSIX conforming sleep() functions.
* include/sys/types.h (useconds_t): Make it explicitly long; int may
diff --git a/mingwrt/Makefile.in b/mingwrt/Makefile.in
index 3decb35..6bc0e8f 100644
--- a/mingwrt/Makefile.in
+++ b/mingwrt/Makefile.in
@@ -555,7 +555,8 @@ libimpl_sed_script = sed \
-e 's/__LIBIMPL.*ALIAS *= *$1[ ,)].*)/__attribute__((__alias__("$1")))/' \
-e '/__CRT_ALIAS *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d'
-LIBIMPL_CFLAGS = $(CFLAGS) $(INCLUDES) -fno-align-functions
+LIBIMPL_CFLAGS = $(CFLAGS) $(INCLUDES) $(LIBIMPL_EXTRA_CFLAGS)
+LIBIMPL_EXTRA_CFLAGS = -fno-align-functions -Wno-deprecated-declarations
# LIBIMPL dependencies are tracked using zero sized name.libimpl
# files; the intermediate C files are generated as a side effect
https://sf.net/p/mingw/mingw-org-wsl/ci/b83d2b297de77aece4b2b37855c69be2431f060b/
commit b83d2b297de77aece4b2b37855c69be2431f060b
Author: Keith Marshall <kei...@us...>
Date: Tue Dec 23 20:59:37 2014 +0000
Provide more POSIX conforming sleep() functions.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 1be4574..8666b9f 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,38 @@
+2014-12-23 Keith Marshall <kei...@us...>
+
+ Provide more POSIX conforming sleep() functions.
+
+ * include/sys/types.h (useconds_t): Make it explicitly long; int may
+ be okay, but doesn't guarantee enough bits; mark as deprecated, since
+ POSIX has declared it "obsolete", and no longer specifies it.
+
+ * mingwex/usleep.c: Delete file; it provided an implementation of...
+ (usleep): ...this now obsolete function, claiming POSIX.1 issue 6, but
+ its error handling was hopelessly broken; replace it with...
+ * mingwex/nsleep.c: ...this new file; it implements...
+ (__mingw_sleep): ...this generic helper function; it supports sleep
+ capability with interval specification to nanosecond precision.
+
+ * include/unistd.h (__mingw_sleep): Declare prototype; use it as the
+ basis for providing __LIBIMPL__ __CRT_INLINE implementations of...
+ (sleep, nanosleep): ...these current POSIX functions, and also...
+ (usleep): ...this obsolete one; mark it as deprecated.
+
+ * include/parts: New directory; it is intended to host partial header
+ implementations, for content which must be shared among arbitrary sets
+ of multiple standard header files.
+
+ * include/parts/time.h: New file; nominally declaring time.h content.
+ (struct timespec): Declare it; it is currently used within unistd.h,
+ to facilitate the __CRT_INLINE implementation of nanosleep().
+
+ * Makefile.in (libmingwex.a): Remove reference to...
+ (usleep.$OBJEXT): ...this; replace it with a reference to...
+ (nsleep.$OBJEXT): ...this alternative.
+ (mingwrt-includedirs): Add prerequisite to create...
+ ($includedir/parts): ...this new directory; it is populated by...
+ (install-mingwrt-headers): ...this rule; add requisite command.
+
2014-12-13 Keith Marshall <kei...@us...>
Delete an unnecessary Unicode wrapper file.
diff --git a/mingwrt/Makefile.in b/mingwrt/Makefile.in
index 87c4d1b..3decb35 100644
--- a/mingwrt/Makefile.in
+++ b/mingwrt/Makefile.in
@@ -443,7 +443,7 @@ $(addsuffix fmt.$(OBJEXT),varo crto geto seto crtn getn setn): %.$(OBJEXT): ofmt
#
#libmingwex.a: $(addsuffix .$(OBJEXT), glob membarrier)
libmingwex.a: $(addsuffix .$(OBJEXT), mingw-aligned-malloc mingw-fseek)
-libmingwex.a: $(addsuffix .$(OBJEXT), glob getopt basename dirname usleep)
+libmingwex.a: $(addsuffix .$(OBJEXT), glob getopt basename dirname nsleep)
libmingwex.a: $(addsuffix .$(OBJEXT), mkstemp mkdtemp cryptnam)
libmingwex.a: $(addsuffix .$(OBJEXT), tdelete tfind tsearch twalk)
@@ -673,13 +673,14 @@ install-mingwrt-license install-w32api-license: install-%: docdir %-files
includedirs: mingwrt-includedirs
install-headers install-mingwrt: install-mingwrt-headers
-${includedir}/sys: includedir
-mingwrt-includedirs: ${includedir}/sys
+${includedir}/sys ${includedir}/parts: includedir
+mingwrt-includedirs: ${includedir}/sys ${includedir}/parts
$(mkinstalldirs) $^
install-mingwrt-headers: mingwrt-includedirs
$(INSTALL_DATA) ${mingwrt_srcdir}/include/*.h ${includedir}
$(INSTALL_DATA) ${mingwrt_srcdir}/include/sys/*.h ${includedir}/sys
+ $(INSTALL_DATA) ${mingwrt_srcdir}/include/parts/*.h ${includedir}/parts
$(INSTALL_DATA) ${mingwrt_srcdir}/profile/*.h ${includedir}
# Install libraries, and supporting free standing object files.
diff --git a/mingwrt/include/parts/time.h b/mingwrt/include/parts/time.h
new file mode 100644
index 0000000..9e19be3
--- /dev/null
+++ b/mingwrt/include/parts/time.h
@@ -0,0 +1,76 @@
+/*
+ * parts/time.h
+ *
+ * Internal header file, declaring types and structures which nominally
+ * originate from time.h, but which POSIX requires to be made visible on
+ * inclusion of certain other headers, without including time.h itself.
+ *
+ * $Id$
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * Copyright (C) 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.
+ *
+ */
+#if _FAKE_TIME_H_SOURCED
+/*
+ * Since we expect this part-header to be sourced exclusively by other
+ * system headers, (nominally time.h), we don't apply any conventional
+ * multiple inclusion guard; rather, we rely on the guard within time.h
+ * itself, but allow other headers to fake it for one-shot inclusion
+ * only...
+ */
+# undef _FAKE_TIME_H_SOURCED
+
+#elif ! defined _TIME_H
+/*
+ * ...otherwise, we fail if the time.h guard is not in place.
+ */
+# error "Never include <parts/time.h> directly; use <time.h> instead"
+#endif
+
+#if defined __need_struct_timespec && ! __struct_timespec_defined
+/*
+ * Structure timespec is mandated by POSIX, for specification of
+ * intervals with the greatest precision supported by the OS kernel.
+ * Although this allows for specification to nanosecond precision, do
+ * not be deluded into any false expectation that such short intervals
+ * can be realized on Windows; on Win9x derivatives, the metronome used
+ * by the process scheduler has a period of ~55 milliseconds, while for
+ * WinNT derivatives, the corresponding period is ~15 milliseconds; thus,
+ * the shortest intervals which can be realistically timed will range
+ * from 0..55 milliseconds on Win9x hosts, and from 0..15 ms on WinNT,
+ * with period values normally distributed around means of ~27.5 ms
+ * and ~7.5 ms, for the two system types respectively.
+ */
+struct timespec
+{
+ /* Period is sum of tv_sec + tv_nsec; use fundamental integer types
+ * to avoid 32-bit vs. 64-bit time_t ambiguity.
+ */
+ long long tv_sec; /* seconds */
+ long tv_nsec; /* nanoseconds */
+};
+# define __struct_timespec_defined 1
+#endif
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/include/sys/types.h b/mingwrt/include/sys/types.h
index 976a3fe..45da5e6 100644
--- a/mingwrt/include/sys/types.h
+++ b/mingwrt/include/sys/types.h
@@ -129,9 +129,9 @@ typedef long long fpos64_t;
typedef long long off64_t;
#endif
-#if !defined __NO_ISOCEXT
-typedef unsigned int useconds_t;
-#endif /* Not __NO_ISOCEXT */
+#if _POSIX_C_SOURCE
+typedef unsigned long useconds_t __MINGW_ATTRIB_DEPRECATED;
+#endif
#endif /* Not RC_INVOKED */
diff --git a/mingwrt/include/unistd.h b/mingwrt/include/unistd.h
index 85a5cf5..b6bd05e 100644
--- a/mingwrt/include/unistd.h
+++ b/mingwrt/include/unistd.h
@@ -1,12 +1,52 @@
#ifndef _UNISTD_H
/*
- * This file is part of the Mingw32 package.
+ * unistd.h
*
- * unistd.h maps (roughly) to io.h
+ * Standard header file declaring MinGW's POSIX compatibility features.
+ *
+ * $Id$
+ *
+ * Written by Rob Savoye <ro...@cy...>
+ * Modified by Earnie Boyd <ea...@us...>
+ * Danny Smith <dan...@us...>
+ * Ramiro Polla <ra...@li...>
+ * Gregory McGarry <gre...@us...>
+ * Keith Marshall <kei...@us...>
+ * Copyright (C) 1997, 1999, 2002-2004, 2007-2009, 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.
+ *
+ */
+#define _UNISTD_H 1
+#pragma GCC system_header
+
+/* All MinGW headers MUST include _mingw.h before anything else,
+ * to ensure proper initialization of feature test macros.
+ */
+#include <_mingw.h>
+
+/* unistd.h maps (roughly) to io.h
* Other headers included by unistd.h may be selectively processed;
* __UNISTD_H_SOURCED__ enables such selective processing.
*/
-#define _UNISTD_H
#define __UNISTD_H_SOURCED__ 1
#include <io.h>
@@ -26,25 +66,105 @@
#define SEEK_END 2
#endif
+#if _POSIX_C_SOURCE
+/*
+ * POSIX process/thread suspension functions; all are supported by a
+ * common MinGW API in libmingwex.a, providing for suspension periods
+ * ranging from mean values of ~7.5 milliseconds, (see comments below),
+ * extending up to a maximum of ~136 years.
+ *
+ * Note that, whereas POSIX supports early wake-up of any suspended
+ * process/thread, in response to a signal, this implementation makes
+ * no attempt to emulate this signalling behaviour, (since signals are
+ * not well supported by Windows); thus, unless impeded by an invalid
+ * argument, this implementation always returns an indication as if
+ * the sleeping period ran to completion.
+ */
+_EXTERN_C _cdecl __MINGW_NOTHROW
+int __mingw_sleep( unsigned long, unsigned long );
+
+/* Structure timespec is mandated by POSIX, for specification of
+ * intervals with the greatest precision supported by the OS kernel.
+ * Although this allows for specification to nanosecond precision, do
+ * not be deluded into any false expectation that such short intervals
+ * can be realized on Windows; on Win9x derivatives, the metronome used
+ * by the process scheduler has a period of ~55 milliseconds, while for
+ * WinNT derivatives, the corresponding period is ~15 milliseconds; thus,
+ * the shortest intervals which can be realistically timed will range
+ * from 0..55 milliseconds on Win9x hosts, and from 0..15 ms on WinNT,
+ * 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
+#include <parts/time.h>
+
_BEGIN_C_DECLS
-#if !defined __NO_ISOCEXT
-#include <sys/types.h> /* For useconds_t. */
+/* The nanosleep() function provides the most general purpose API for
+ * process/thread suspension; it provides for specification of periods
+ * ranging from ~7.5 ms mean, (on WinNT derivatives; ~27.5 ms on Win9x),
+ * extending up to ~136 years, (effectively eternity).
+ */
+_cdecl __MINGW_NOTHROW
+int nanosleep( const struct timespec *, struct timespec * );
-int __cdecl __MINGW_NOTHROW usleep(useconds_t useconds);
-#endif /* Not __NO_ISOCEXT */
+#ifndef __NO_INLINE__
+__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)
+ ? (unsigned)(-1) : (unsigned)(period->tv_nsec));
+}
+#endif
-/* This is defined both as a real library function, to allow autoconf
- * to verify its existence, and as a potentially inline implementation.
+/* The usleep() function, and its associated useconds_t type specifier
+ * were made obsolete in POSIX.1-2008; declared here, only for backward
+ * compatibility, its continued use is not recommended. (It is limited
+ * to specification of suspension periods ranging from ~7.5 ms mean up
+ * to a maximum of 999,999 microseconds only).
*/
-int ftruncate(int, off_t);
+typedef unsigned long useconds_t __MINGW_ATTRIB_DEPRECATED;
+int _cdecl __MINGW_NOTHROW usleep( useconds_t )__MINGW_ATTRIB_DEPRECATED;
+
+#ifndef __NO_INLINE__
+__CRT_INLINE __LIBIMPL__(( FUNCTION = usleep ))
+int usleep( useconds_t period ){ return __mingw_sleep( 0, 1000 * period ); }
+#endif
+
+/* The sleep() function is, perhaps, the most commonly used of all the
+ * process/thread suspension APIs; it provides support for specification
+ * of suspension periods ranging from 1 second to ~136 years. (However,
+ * POSIX recommends limiting the maximum period to 65535 seconds, to
+ * maintain portability to platforms with only 16-bit ints).
+ */
+unsigned _cdecl __MINGW_NOTHROW sleep( unsigned );
+
+#ifndef __NO_INLINE__
+__CRT_INLINE __LIBIMPL__(( FUNCTION = sleep ))
+unsigned sleep( unsigned period ){ return __mingw_sleep( period, 0 ); }
+#endif
+
+
+/* POSIX ftruncate() function.
+ *
+ * Microsoft's _chsize() function is incorrectly described, on MSDN,
+ * as a preferred replacement for the POSIX chsize() function. There
+ * never was any such POSIX function; the actual POSIX equivalent is
+ * the ftruncate() function.
+ */
+int _cdecl ftruncate( int, off_t );
+
#ifndef __NO_INLINE__
__CRT_INLINE __JMPSTUB__(( FUNCTION = ftruncate, REMAPPED = _chsize ))
-int ftruncate(int __fd, off_t __length)
-{ return _chsize (__fd, __length); }
+int ftruncate( int __fd, off_t __length ){ return _chsize( __fd, __length ); }
#endif
_END_C_DECLS
+#endif /* _POSIX_C_SOURCE */
+
#undef __UNISTD_H_SOURCED__
-#endif /* _UNISTD_H */
+#endif /* ! _UNISTD_H: $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/nsleep.c b/mingwrt/mingwex/nsleep.c
new file mode 100644
index 0000000..646e4b5
--- /dev/null
+++ b/mingwrt/mingwex/nsleep.c
@@ -0,0 +1,107 @@
+/*
+ * nsleep.c
+ *
+ * Core implementation of the __mingw_sleep() API, which facilitates the
+ * provision of (mostly) POSIX compliant sleep(), usleep(), and nanosleep()
+ * functions, (per inline implementations in unistd.h).
+ *
+ * $Id$
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * Copyright (C) 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.
+ *
+ */
+#include <errno.h>
+#include <limits.h>
+#include <unistd.h>
+
+/* Including windows.h, just to declare Sleep(), seems like overkill; we
+ * prefer to declare it directly, to ensure we get the kernel DLL import,
+ * without the overhead of redirection through a libkernel.a trampoline.
+ */
+__declspec(dllimport) _stdcall void Sleep( unsigned long );
+
+int __mingw_sleep( unsigned long secs, unsigned long nsecs )
+{
+ /* Entry point for general purpose sleep() function API, supporting
+ * the __CRT_INLINE implementations of the three functions identified
+ * in the file description above.
+ */
+ if( (secs | nsecs) > 0UL )
+ {
+ /* At least one of the seconds or nanoseconds components must
+ * be non-zero, to require us to perform any action.
+ */
+ if( nsecs < 1000000000UL )
+ {
+ /* POSIX requires the nanoseconds component of the specified
+ * interval to be less than one full second (1,000,000,000 ns);
+ * we've satisfied that requirement, so we proceed to combine
+ * the seconds and nanoseconds components into a millisecond
+ * representation, as required by the kernel's Sleep() API,
+ * (using a 64-bit representation, to avoid overflow).
+ */
+ unsigned long long interval = (secs > 0UL)
+ ? secs * 1000ULL + ((nsecs > 0UL) ? nsecs / 1000000ULL : 0ULL)
+ : (nsecs + 999999ULL) / 1000000ULL;
+
+ /* It is unlikely that we should ever need this, (but it is
+ * possible, so we proceed defensively)...
+ */
+ while( interval > (unsigned long long)(LONG_MAX) )
+ {
+ /* ...breaking excessively long intervals into cycles of
+ * LONG_MAX milliseconds, (~25 days, and we may be asked
+ * to sleep through up to 2000 cycles, or ~136 years), so
+ * that we avoid any interval value with the high bit set
+ * (lest that be interpreted as "sleep forever").
+ */
+ Sleep( (unsigned long)(LONG_MAX) );
+ interval -= (unsigned long long)(LONG_MAX);
+ }
+ /* Since suspension requests of 25 days are unlikely, in
+ * the majority of cases we should simply skip over the
+ * preceding loop; we must still call Sleep(), either to
+ * satisfy the original request in its entirety, or the
+ * residual from the loop.
+ */
+ Sleep( (unsigned long)(interval) );
+ }
+ else
+ { /* We were given a nanoseconds component value, within the
+ * interval specification, which exceeds one full second; in
+ * this event, POSIX specifies the following failure:
+ */
+ errno = EINVAL;
+ return -1;
+ }
+ }
+ /* On success, or maybe having done nothing at all, we simply
+ * return zero; (note that Windows Sleep() isn't interruptible
+ * in the way that that POSIX sleep() is, so we do not provide
+ * any indication of an uncompleted interval).
+ */
+ return 0;
+}
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/usleep.c b/mingwrt/mingwex/usleep.c
deleted file mode 100644
index c059c06..0000000
--- a/mingwrt/mingwex/usleep.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * usleep
- * Implementation according to:
- * The Open Group Base Specifications Issue 6
- * IEEE Std 1003.1, 2004 Edition
- */
-
-/*
- * THIS SOFTWARE IS NOT COPYRIGHTED
- *
- * This source code is offered for use in the public domain. You may
- * use, modify or distribute it freely.
- *
- * This code is distributed in the hope that it will be useful but
- * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- * DISCLAIMED. This includes but is not limited to warranties of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Contributed by:
- * Ramiro Polla <ra...@li...>
- */
-
-#include <sys/types.h>
-#include <errno.h>
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-int __cdecl usleep(useconds_t useconds)
-{
- if(useconds == 0)
- return 0;
-
- if(useconds >= 1000000)
- return EINVAL;
-
- Sleep((useconds + 999) / 1000);
-
- return 0;
-}
-----------------------------------------------------------------------
Summary of changes:
mingwrt/ChangeLog | 52 ++++++++++++++
mingwrt/Makefile.in | 10 ++-
mingwrt/include/parts/time.h | 76 ++++++++++++++++++++
mingwrt/include/stdio.h | 9 ++-
mingwrt/include/sys/types.h | 6 +-
mingwrt/include/unistd.h | 159 ++++++++++++++++++++++++++++++++++++------
mingwrt/mingwex/nsleep.c | 107 ++++++++++++++++++++++++++++
mingwrt/mingwex/usleep.c | 40 -----------
8 files changed, 386 insertions(+), 73 deletions(-)
create mode 100644 mingwrt/include/parts/time.h
create mode 100644 mingwrt/mingwex/nsleep.c
delete mode 100644 mingwrt/mingwex/usleep.c
hooks/post-receive
--
Repository: mingw-org-wsl
|
|
From: Keith M. <no...@so...> - 2014-12-13 21:39:57
|
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 f3ab46526f1432c60d012f68783374375897760c (commit)
from febb420d919743a78ab0d65ce62c996f3fd9463a (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/f3ab46526f1432c60d012f68783374375897760c/
commit f3ab46526f1432c60d012f68783374375897760c
Author: Keith Marshall <kei...@us...>
Date: Sat Dec 13 21:28:16 2014 +0000
Delete an unnecessary Unicode wrapper file.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index b26d1f1..1be4574 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,12 @@
2014-12-13 Keith Marshall <kei...@us...>
+ Delete an unnecessary Unicode wrapper file.
+
+ * mingwex/wdirent.c: Delete it; Makefile.in knows how to compile the
+ UTF-16LE API from dirent.c, without any need for this wrapper.
+
+2014-12-13 Keith Marshall <kei...@us...>
+
Some further inline function rationalization.
* include/io.h (_CRTALIAS): Replace all references...
diff --git a/mingwrt/mingwex/wdirent.c b/mingwrt/mingwex/wdirent.c
deleted file mode 100644
index 6dcf42b..0000000
--- a/mingwrt/mingwex/wdirent.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#define _UNICODE 1
-#define UNICODE 1
-
-#include <wchar.h>
-#include "dirent.c"
-----------------------------------------------------------------------
Summary of changes:
mingwrt/ChangeLog | 7 +++++++
mingwrt/mingwex/wdirent.c | 5 -----
2 files changed, 7 insertions(+), 5 deletions(-)
delete mode 100644 mingwrt/mingwex/wdirent.c
hooks/post-receive
--
Repository: mingw-org-wsl
|
|
From: Keith M. <no...@so...> - 2014-12-13 17:26:43
|
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 febb420d919743a78ab0d65ce62c996f3fd9463a (commit)
via 1653be00bf697996b027bfdec048be0eeff58502 (commit)
from 8c52b6157142cb9352fd0771180dc1977887af8b (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/febb420d919743a78ab0d65ce62c996f3fd9463a/
commit febb420d919743a78ab0d65ce62c996f3fd9463a
Author: Keith Marshall <kei...@us...>
Date: Sat Dec 13 17:25:17 2014 +0000
Some further inline function rationalization.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 5addd8c..b26d1f1 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,23 @@
2014-12-13 Keith Marshall <kei...@us...>
+ Some further inline function rationalization.
+
+ * include/io.h (_CRTALIAS): Replace all references...
+ (__CRT_ALIAS): ...using this syntactically preferred form.
+ (lseek64): Specify __JMPSTUB__ semantics for extern implementation.
+ [__cplusplus] (_BEGIN_C_DECLS, _END_C_DECLS): Use these.
+
+ * include/unistd.h (ftruncate): Specify __JMPSTUB__ semantics.
+ [__cplusplus] (_BEGIN_C_DECLS, _END_C_DECLS): Use these.
+
+ * mingwex/stdio/lseek64.c: File is now redundant; delete it.
+ * mingwex/ftruncate.c: Likewise.
+
+ * Makefile.in (libmingwex.a): Delete obsolete dependencies on...
+ (lseek64.$OBJEXT, ftruncate.$OBJEXT): ...these.
+
+2014-12-13 Keith Marshall <kei...@us...>
+
Some POSIX feature test adjustments.
* include/stdlib.h (mkstemp): Available since SUSv3, so requires...
diff --git a/mingwrt/Makefile.in b/mingwrt/Makefile.in
index 79c829e..87c4d1b 100644
--- a/mingwrt/Makefile.in
+++ b/mingwrt/Makefile.in
@@ -420,8 +420,8 @@ libmingwex.a: $(addsuffix .$(OBJEXT), cosf cosl acosf acosl sinf sinl asinf \
# compatibility than their Microsoft equivalents.
#
vpath %.c ${mingwrt_srcdir}/mingwex/stdio
-libmingwex.a: $(addsuffix .$(OBJEXT), btowc fprintf fseeko64 lseek64 \
- pformat printf snprintf snwprintf sprintf vfprintf vfscanf vfwscanf vprintf \
+libmingwex.a: $(addsuffix .$(OBJEXT), btowc fprintf fseeko64 pformat \
+ printf snprintf snwprintf sprintf vfprintf vfscanf vfwscanf vprintf \
vscanf vsnprintf vsnwprintf vsprintf vsscanf vswscanf vwscanf)
# pformat.$(OBJEXT) needs an explicit build rule, since we need to
@@ -442,8 +442,8 @@ $(addsuffix fmt.$(OBJEXT),varo crto geto seto crtn getn setn): %.$(OBJEXT): ofmt
# Some additional miscellaneous functions, in libmingwex.a
#
#libmingwex.a: $(addsuffix .$(OBJEXT), glob membarrier)
-libmingwex.a: $(addsuffix .$(OBJEXT), mingw-aligned-malloc mingw-fseek glob)
-libmingwex.a: $(addsuffix .$(OBJEXT), getopt basename dirname ftruncate usleep)
+libmingwex.a: $(addsuffix .$(OBJEXT), mingw-aligned-malloc mingw-fseek)
+libmingwex.a: $(addsuffix .$(OBJEXT), glob getopt basename dirname usleep)
libmingwex.a: $(addsuffix .$(OBJEXT), mkstemp mkdtemp cryptnam)
libmingwex.a: $(addsuffix .$(OBJEXT), tdelete tfind tsearch twalk)
diff --git a/mingwrt/include/io.h b/mingwrt/include/io.h
index d0ca5f8..535c658 100644
--- a/mingwrt/include/io.h
+++ b/mingwrt/include/io.h
@@ -185,9 +185,7 @@ struct _wfinddata64i32_t {
#define _WFINDDATA_T_DEFINED
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
+_BEGIN_C_DECLS
/*
* Functions for searching for files. _findfirst returns -1 if no match
@@ -273,20 +271,33 @@ _CRTIMP int __cdecl __MINGW_NOTHROW _findnext64(intptr_t, struct __finddata64_t*
#endif /* __MSVCRT_VERSION__ >= 0x0601 */
#if __MSVCRT_VERSION__ >= 0x0800
#ifndef _USE_32BIT_TIME_T
-_CRTALIAS intptr_t __cdecl __MINGW_NOTHROW _findfirst (const char* _v1, struct _finddata_t* _v2) { return(_findfirst64i32 (_v1,(struct _finddata64i32_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _findnext (intptr_t _v1, struct _finddata_t* _v2) { return(_findnext64i32 (_v1,(struct _finddata64i32_t*)_v2)); }
-_CRTALIAS intptr_t __cdecl __MINGW_NOTHROW _findfirsti64 (const char* _v1, struct _finddatai64_t* _v2) { return(_findfirst64 (_v1,(struct __finddata64_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _findnexti64 (intptr_t _v1, struct _finddatai64_t* _v2) { return(_findnext64 (_v1,(struct __finddata64_t*)_v2)); }
+/* No __JMPSTUB__ or __LIBIMPL__ here; all of these represent
+ * call redirections within the MSVC runtime library itself.
+ */
+__CRT_ALIAS intptr_t __cdecl __MINGW_NOTHROW _findfirst (const char* _v1, struct _finddata_t* _v2)
+{ return(_findfirst64i32 (_v1,(struct _finddata64i32_t*)_v2)); }
+__CRT_ALIAS int __cdecl __MINGW_NOTHROW _findnext (intptr_t _v1, struct _finddata_t* _v2)
+{ return(_findnext64i32 (_v1,(struct _finddata64i32_t*)_v2)); }
+__CRT_ALIAS intptr_t __cdecl __MINGW_NOTHROW _findfirsti64 (const char* _v1, struct _finddatai64_t* _v2)
+{ return(_findfirst64 (_v1,(struct __finddata64_t*)_v2)); }
+__CRT_ALIAS int __cdecl __MINGW_NOTHROW _findnexti64 (intptr_t _v1, struct _finddatai64_t* _v2)
+{ return(_findnext64 (_v1,(struct __finddata64_t*)_v2)); }
#else
-_CRTALIAS intptr_t __cdecl __MINGW_NOTHROW _findfirst (const char* _v1, struct _finddata_t* _v2) { return(_findfirst32 (_v1,(struct _finddata32_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _findnext (intptr_t _v1, struct _finddata_t* _v2) { return(_findnext32 (_v1,(struct _finddata32_t*)_v2)); }
-_CRTALIAS intptr_t __cdecl __MINGW_NOTHROW _findfirsti64 (const char* _v1, struct _finddatai64_t* _v2) { return(_findfirst32i64 (_v1,(struct _finddata32i64_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _findnexti64 (intptr_t _v1, struct _finddatai64_t* _v2) { return(_findnext32i64 (_v1,(struct _finddata32i64_t*)_v2)); }
+__CRT_ALIAS intptr_t __cdecl __MINGW_NOTHROW _findfirst (const char* _v1, struct _finddata_t* _v2)
+{ return(_findfirst32 (_v1,(struct _finddata32_t*)_v2)); }
+__CRT_ALIAS int __cdecl __MINGW_NOTHROW _findnext (intptr_t _v1, struct _finddata_t* _v2)
+{ return(_findnext32 (_v1,(struct _finddata32_t*)_v2)); }
+__CRT_ALIAS intptr_t __cdecl __MINGW_NOTHROW _findfirsti64 (const char* _v1, struct _finddatai64_t* _v2)
+{ return(_findfirst32i64 (_v1,(struct _finddata32i64_t*)_v2)); }
+__CRT_ALIAS int __cdecl __MINGW_NOTHROW _findnexti64 (intptr_t _v1, struct _finddatai64_t* _v2)
+{ return(_findnext32i64 (_v1,(struct _finddata32i64_t*)_v2)); }
#endif /* !_USE_32BIT_TIME_T */
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
+
#ifndef __NO_MINGW_LFS
__CRT_INLINE off64_t lseek64 (int, off64_t, int);
-__CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence)
+__CRT_INLINE __JMPSTUB__(( FUNCTION = lseek64, REMAPPED = _lseeki64 ))
+off64_t lseek64 (int fd, off64_t offset, int whence)
{
return _lseeki64(fd, (__int64) offset, whence);
}
@@ -307,9 +318,7 @@ _CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int);
#endif /* Not _NO_OLDNAMES */
-#ifdef __cplusplus
-}
-#endif
+_END_C_DECLS
#endif /* Not RC_INVOKED */
@@ -328,9 +337,7 @@ _CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int);
#ifndef RC_INVOKED
-#ifdef __cplusplus
-extern "C" {
-#endif
+_BEGIN_C_DECLS
_CRTIMP int __cdecl __MINGW_NOTHROW _access (const char*, int);
_CRTIMP int __cdecl __MINGW_NOTHROW _chsize (int, long);
@@ -416,15 +423,26 @@ _CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfindda
#endif
#if __MSVCRT_VERSION__ >= 0x0800
#ifndef _USE_32BIT_TIME_T
-_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2) { return(_wfindfirst64i32 (_v1,(struct _wfinddata64i32_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnext (long _v1, struct _wfinddata_t* _v2) { return(_wfindnext64i32 (_v1,(struct _wfinddata64i32_t*)_v2)); }
-_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2) { return(_wfindfirst64 (_v1,(struct __wfinddata64_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnexti64 (long _v1, struct _wfinddatai64_t* _v2) { return(_wfindnext64 (_v1,(struct __wfinddata64_t*)_v2)); }
+/* No __JMPSTUB__ or __LIBIMPL__ here; all of these represent
+ * call redirections within the MSVC runtime library itself.
+ */
+__CRT_ALIAS long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2)
+{ return(_wfindfirst64i32 (_v1,(struct _wfinddata64i32_t*)_v2)); }
+__CRT_ALIAS int __cdecl __MINGW_NOTHROW _wfindnext (long _v1, struct _wfinddata_t* _v2)
+{ return(_wfindnext64i32 (_v1,(struct _wfinddata64i32_t*)_v2)); }
+__CRT_ALIAS long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2)
+{ return(_wfindfirst64 (_v1,(struct __wfinddata64_t*)_v2)); }
+__CRT_ALIAS int __cdecl __MINGW_NOTHROW _wfindnexti64 (long _v1, struct _wfinddatai64_t* _v2)
+{ return(_wfindnext64 (_v1,(struct __wfinddata64_t*)_v2)); }
#else
-_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2) { return(_wfindfirst32 (_v1,(struct __wfinddata32_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnext (long _v1, struct _wfinddata_t* _v2) { return(_wfindnext32 (_v1,(struct __wfinddata32_t*)_v2)); }
-_CRTALIAS long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2) { return(_wfindfirst32i64 (_v1,(struct _wfinddata32i64_t*)_v2)); }
-_CRTALIAS int __cdecl __MINGW_NOTHROW _wfindnexti64 (long _v1, struct _wfinddatai64_t* _v2) { return(_wfindnext32i64 (_v1,(struct _wfinddata32i64_t*)_v2)); }
+__CRT_ALIAS long __cdecl __MINGW_NOTHROW _wfindfirst (const wchar_t* _v1, struct _wfinddata_t* _v2)
+{ return(_wfindfirst32 (_v1,(struct __wfinddata32_t*)_v2)); }
+__CRT_ALIAS int __cdecl __MINGW_NOTHROW _wfindnext (long _v1, struct _wfinddata_t* _v2)
+{ return(_wfindnext32 (_v1,(struct __wfinddata32_t*)_v2)); }
+__CRT_ALIAS long __cdecl __MINGW_NOTHROW _wfindfirsti64 (const wchar_t* _v1, struct _wfinddatai64_t* _v2)
+{ return(_wfindfirst32i64 (_v1,(struct _wfinddata32i64_t*)_v2)); }
+__CRT_ALIAS int __cdecl __MINGW_NOTHROW _wfindnexti64 (long _v1, struct _wfinddatai64_t* _v2)
+{ return(_wfindnext32i64 (_v1,(struct _wfinddata32i64_t*)_v2)); }
#endif /* !_USE_32BIT_TIME_T */
#endif /* __MSVCRT_VERSION__ >= 0x0800 */
#endif /* defined (__MSVCRT__) */
@@ -484,9 +502,7 @@ wchar_t * wmktemp(wchar_t *);
#endif /* Not _NO_OLDNAMES */
-#ifdef __cplusplus
-}
-#endif
+_END_C_DECLS
#endif /* Not RC_INVOKED */
diff --git a/mingwrt/include/unistd.h b/mingwrt/include/unistd.h
index 5b828eb..85a5cf5 100644
--- a/mingwrt/include/unistd.h
+++ b/mingwrt/include/unistd.h
@@ -26,9 +26,7 @@
#define SEEK_END 2
#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
+_BEGIN_C_DECLS
#if !defined __NO_ISOCEXT
#include <sys/types.h> /* For useconds_t. */
@@ -36,19 +34,17 @@ extern "C" {
int __cdecl __MINGW_NOTHROW usleep(useconds_t useconds);
#endif /* Not __NO_ISOCEXT */
-/* This is defined as a real library function to allow autoconf
- to verify its existence. */
+/* This is defined both as a real library function, to allow autoconf
+ * to verify its existence, and as a potentially inline implementation.
+ */
int ftruncate(int, off_t);
#ifndef __NO_INLINE__
-__CRT_INLINE int ftruncate(int __fd, off_t __length)
-{
- return _chsize (__fd, __length);
-}
+__CRT_INLINE __JMPSTUB__(( FUNCTION = ftruncate, REMAPPED = _chsize ))
+int ftruncate(int __fd, off_t __length)
+{ return _chsize (__fd, __length); }
#endif
-#ifdef __cplusplus
-}
-#endif
+_END_C_DECLS
#undef __UNISTD_H_SOURCED__
#endif /* _UNISTD_H */
diff --git a/mingwrt/mingwex/ftruncate.c b/mingwrt/mingwex/ftruncate.c
deleted file mode 100644
index fdb6295..0000000
--- a/mingwrt/mingwex/ftruncate.c
+++ /dev/null
@@ -1,5 +0,0 @@
-#include <unistd.h>
-int ftruncate(int __fd, off_t __length)
-{
- return _chsize (__fd, __length);
-}
diff --git a/mingwrt/mingwex/stdio/lseek64.c b/mingwrt/mingwex/stdio/lseek64.c
deleted file mode 100644
index 8362970..0000000
--- a/mingwrt/mingwex/stdio/lseek64.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <io.h>
-
-off64_t lseek64
-(int fd, off64_t offset, int whence)
-{
- return _lseeki64(fd, (__int64) offset, whence);
-}
-
https://sf.net/p/mingw/mingw-org-wsl/ci/1653be00bf697996b027bfdec048be0eeff58502/
commit 1653be00bf697996b027bfdec048be0eeff58502
Author: Keith Marshall <kei...@us...>
Date: Sat Dec 13 16:59:47 2014 +0000
Some POSIX feature test adjustments.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index dff360f..5addd8c 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,12 @@
+2014-12-13 Keith Marshall <kei...@us...>
+
+ Some POSIX feature test adjustments.
+
+ * include/stdlib.h (mkstemp): Available since SUSv3, so requires...
+ [_POSIX_C_SOURCE >= 200112L]: ...this minimum level of POSIX support.
+ (mkdtemp): This didn't become available until SUSv4, so requires...
+ [_POSIX_C_SOURCE >= 200809L]: ...this increased feature level.
+
2014-12-11 Keith Marshall <kei...@us...>
Another CRT_INLINE function implementation rationalization.
diff --git a/mingwrt/include/stdlib.h b/mingwrt/include/stdlib.h
index 71a1b86..516f636 100644
--- a/mingwrt/include/stdlib.h
+++ b/mingwrt/include/stdlib.h
@@ -556,17 +556,14 @@ wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, in
#endif /* __MSVCRT__ */
#endif /* !__NO_ISOCEXT */
-#if !defined __STRICT_ANSI__
-/*
- * POSIX/BSD extensions in libmingwex.a; maybe these should be exposed only on
- * the basis of some POSIX or BSD specific feature tests, but for convenience,
- * we require only !__STRICT_ANSI__
- *
+/* POSIX/BSD extensions in libmingwex.a; these should be exposed only on
+ * the basis of appropriate POSIX or BSD specific feature tests...
*
* mkstemp(3) function support; added per feature request #2003.
- * POSIX wants _XOPEN_SOURCE >= 500, (implying _POSIX_C_SOURCE >= 200112L),
- * but, as noted above, we will settle for !__STRICT_ANSI__.
+ * POSIX wants _XOPEN_SOURCE >= 500, (implying _POSIX_C_SOURCE >= 200112L).
*/
+#if _POSIX_C_SOURCE >= 200112L
+
int __cdecl __MINGW_NOTHROW mkstemp( char * );
int __cdecl __MINGW_NOTHROW __mingw_mkstemp( int, char * );
@@ -588,10 +585,13 @@ __CRT_ALIAS __LIBIMPL__(( FUNCTION = mkstemp ))
int __cdecl __MINGW_NOTHROW mkstemp( char *__filename_template )
{ return __mingw_mkstemp( _MKSTEMP_INVOKE, __filename_template ); }
+#endif /* _POSIX_C_SOURCE >= 200112L (for mkstemp()) */
+
/* mkdtemp(3) function support: added as adjunct to feature request #2003.
- * POSIX wants _XOPEN_SOURCE >= 700, (implying _POSIX_C_SOURCE >= 200809L),
- * but once again, we will settle for !__STRICT_ANSI__.
+ * POSIX wants _XOPEN_SOURCE >= 700, (implying _POSIX_C_SOURCE >= 200809L).
*/
+#if _POSIX_C_SOURCE >= 200809L
+
char * __cdecl __MINGW_NOTHROW mkdtemp( char * );
char * __cdecl __MINGW_NOTHROW __mingw_mkdtemp( char * );
@@ -599,7 +599,7 @@ __CRT_ALIAS __JMPSTUB__(( FUNCTION = mkdtemp ))
char * __cdecl __MINGW_NOTHROW mkdtemp( char *__dirname_template )
{ return __mingw_mkdtemp( __dirname_template ); }
-#endif /* (!__STRICT_ANSI__) */
+#endif /* _POSIX_C_SOURCE >= 200809L (for mkdtemp()) */
_END_C_DECLS
-----------------------------------------------------------------------
Summary of changes:
mingwrt/ChangeLog | 27 ++++++++++++++
mingwrt/Makefile.in | 8 ++--
mingwrt/include/io.h | 74 +++++++++++++++++++++++---------------
mingwrt/include/stdlib.h | 22 ++++++------
mingwrt/include/unistd.h | 20 ++++------
mingwrt/mingwex/ftruncate.c | 5 ---
mingwrt/mingwex/stdio/lseek64.c | 8 ----
7 files changed, 95 insertions(+), 69 deletions(-)
delete mode 100644 mingwrt/mingwex/ftruncate.c
delete mode 100644 mingwrt/mingwex/stdio/lseek64.c
hooks/post-receive
--
Repository: mingw-org-wsl
|
|
From: Keith M. <no...@so...> - 2014-12-11 23:01:22
|
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 8c52b6157142cb9352fd0771180dc1977887af8b (commit)
via 488c010e452229324f630519f6f7ca5cb9659e9a (commit)
via 5fe775d1a06f8abccfec9b204c3091a447294556 (commit)
via 784739f5bb675ac1cc9103606e487735aac1ae3b (commit)
via 8cd2522438079d26ab866d7c04b896b50db7bdb1 (commit)
via 60ca03220cdd2b56a5323e64c1ce375fcd5387c2 (commit)
via c5bb88dcc205216c28fdd31dcaea1ae039ab480c (commit)
via 764145b2e3b29f1ac4b8651d8dbaaf5949843d32 (commit)
via ed7dcf1eb8b2fefb647b45a3f472524bb63fd870 (commit)
via f28d62f21ffb03ac8a2545db3a3e672221e55f51 (commit)
from fbd0c4aa878040daf047fd34aca04e13f707542c (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/8c52b6157142cb9352fd0771180dc1977887af8b/
commit 8c52b6157142cb9352fd0771180dc1977887af8b
Author: Keith Marshall <kei...@us...>
Date: Thu Dec 11 22:40:07 2014 +0000
Another CRT_INLINE function implementation rationalization.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 41a6fb0..dff360f 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,19 @@
2014-12-11 Keith Marshall <kei...@us...>
+ Another CRT_INLINE function implementation rationalization.
+
+ * include/inttypes.h (imaxabs): Specify as __LIBIMPL__; declare...
+ (llabs): ...this, to be implemented as its __LIBIMPL__ alias.
+ [__cplusplus] (_BEGIN_C_DECLS, _END_C_DECLS): Use these.
+
+ * Makefile.in (libimpl_sed_script): Handle ALIAS attribute.
+ (libmingwex.a): Delete obsolete dependency on...
+ (imaxabs.$OBJEXT): ...this.
+
+ * mingwex/imaxabs.c: File is now redundant; delete it.
+
+2014-12-11 Keith Marshall <kei...@us...>
+
More rationalization of CRT_INLINE function implementations.
* include/stdio.h (fopen64): Add __JMPSTUP__ specification.
@@ -9,7 +23,7 @@
* mingwex/stdio/fopen64.c: File is now redundant; delete it.
* mingwex/stdio/ftell064.c: Likewise.
- * Makefile.in (libmingwex.a): Delete obsolete dependencies...
+ * Makefile.in (libmingwex.a): Delete obsolete dependencies on...
(fopen64.$OBJEXT, ftello64.$OBJEXT): ...these.
2014-12-11 Keith Marshall <kei...@us...>
diff --git a/mingwrt/Makefile.in b/mingwrt/Makefile.in
index 6bb20a0..79c829e 100644
--- a/mingwrt/Makefile.in
+++ b/mingwrt/Makefile.in
@@ -392,7 +392,7 @@ libmingwex.a: $(addsuffix .$(OBJEXT), g__fmt gethex strtopx g_dfmt gdtoa \
# "inttypes" conversion routines, provided in libmingwex.a
#
libmingwex.a: $(addsuffix .$(OBJEXT), \
- imaxabs imaxdiv strtoimax strtoumax wcstoimax wcstoumax)
+ imaxdiv strtoimax strtoumax wcstoimax wcstoumax)
# Additional math functions, augmenting Microsoft's paltry
# selection, also delivered in libmingwex.a, (FIXME: and yet
@@ -550,9 +550,10 @@ libimpl_awk_script = test -z "$1" || awk '\
# which identifies the originating file as a system header).
#
libimpl_sed_script = sed \
- -e '/__CRT_ALIAS *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d' \
+ -e '/pragma .* system_header/d' \
-e '/__CRT_INLINE *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d' \
- -e '/pragma .* system_header/d'
+ -e 's/__LIBIMPL.*ALIAS *= *$1[ ,)].*)/__attribute__((__alias__("$1")))/' \
+ -e '/__CRT_ALIAS *__LIBIMPL.*FUNCTION *= *$1[ ,)].*)/d'
LIBIMPL_CFLAGS = $(CFLAGS) $(INCLUDES) -fno-align-functions
diff --git a/mingwrt/include/inttypes.h b/mingwrt/include/inttypes.h
index 723d3b4..e5e5d5b 100644
--- a/mingwrt/include/inttypes.h
+++ b/mingwrt/include/inttypes.h
@@ -8,9 +8,7 @@
#define __need_wchar_t
#include <stddef.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+_BEGIN_C_DECLS
typedef struct {
intmax_t quot;
@@ -257,9 +255,19 @@ typedef struct {
intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j);
#ifndef __NO_INLINE__
-__CRT_INLINE intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t j)
- {return (j >= 0 ? j : -j);}
+__CRT_INLINE __LIBIMPL__(( FUNCTION = imaxabs ))
+intmax_t __cdecl __MINGW_NOTHROW imaxabs (intmax_t __j)
+{ return __j >= 0 ? __j : -__j; }
+
+/* Since intmax_t is effectively analogous to long long, the preceding
+ * implementation will serve admirably as the external representation of
+ * both imaxabs() and llabs(); declare so here, by providing a prototype
+ * only, with the corresponding inline implementation in stdlib.h
+ */
+__CRT_INLINE __LIBIMPL__(( ALIAS = imaxabs ))
+long long llabs (long long);
#endif
+
imaxdiv_t __cdecl __MINGW_NOTHROW imaxdiv (intmax_t numer, intmax_t denom);
/* 7.8.2 Conversion functions for greatest-width integer types */
@@ -274,8 +282,6 @@ intmax_t __cdecl __MINGW_NOTHROW wcstoimax (const wchar_t* __restrict__ nptr,
uintmax_t __cdecl __MINGW_NOTHROW wcstoumax (const wchar_t* __restrict__ nptr,
wchar_t** __restrict__ endptr, int base);
-#ifdef __cplusplus
-}
-#endif
+_END_C_DECLS
#endif /* ndef _INTTYPES_H */
diff --git a/mingwrt/mingwex/imaxabs.c b/mingwrt/mingwex/imaxabs.c
deleted file mode 100644
index df15673..0000000
--- a/mingwrt/mingwex/imaxabs.c
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- This source code was extracted from the Q8 package created and
- placed in the PUBLIC DOMAIN by Doug Gwyn <gw...@ar...>
- last edit: 1999/11/05 gw...@ar...
-
- Implements subclause 7.8.2 of ISO/IEC 9899:1999 (E).
-
- This particular implementation requires the matching <inttypes.h>.
-*/
-
-#include <inttypes.h>
-
-intmax_t
-imaxabs (intmax_t _j)
- { return _j >= 0 ? _j : -_j; }
-
-long long __attribute__ ((alias ("imaxabs"))) llabs (long long);
https://sf.net/p/mingw/mingw-org-wsl/ci/488c010e452229324f630519f6f7ca5cb9659e9a/
commit 488c010e452229324f630519f6f7ca5cb9659e9a
Author: Keith Marshall <kei...@us...>
Date: Thu Dec 11 22:16:45 2014 +0000
More rationalization of CRT_INLINE function implementations.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index cbc429d..41a6fb0 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,19 @@
2014-12-11 Keith Marshall <kei...@us...>
+ More rationalization of CRT_INLINE function implementations.
+
+ * include/stdio.h (fopen64): Add __JMPSTUP__ specification.
+ (ftello64): Add __LIBIMPL__ specification for extern implementation.
+ [__cplusplus] (_BEGIN_C_DECLS, _END_C_DECLS): Use these.
+
+ * mingwex/stdio/fopen64.c: File is now redundant; delete it.
+ * mingwex/stdio/ftell064.c: Likewise.
+
+ * Makefile.in (libmingwex.a): Delete obsolete dependencies...
+ (fopen64.$OBJEXT, ftello64.$OBJEXT): ...these.
+
+2014-12-11 Keith Marshall <kei...@us...>
+
Don't implicitly define _POSIX_C_SOURCE too early.
* include/_mingw.h (_POSIX_C_SOURCE): Delay implict definition.
diff --git a/mingwrt/Makefile.in b/mingwrt/Makefile.in
index 36f51af..6bb20a0 100644
--- a/mingwrt/Makefile.in
+++ b/mingwrt/Makefile.in
@@ -420,9 +420,9 @@ libmingwex.a: $(addsuffix .$(OBJEXT), cosf cosl acosf acosl sinf sinl asinf \
# compatibility than their Microsoft equivalents.
#
vpath %.c ${mingwrt_srcdir}/mingwex/stdio
-libmingwex.a: $(addsuffix .$(OBJEXT), btowc fopen64 fprintf fseeko64 ftello64 \
- lseek64 pformat printf snprintf snwprintf sprintf vfprintf vfscanf vfwscanf \
- vprintf vscanf vsnprintf vsnwprintf vsprintf vsscanf vswscanf vwscanf)
+libmingwex.a: $(addsuffix .$(OBJEXT), btowc fprintf fseeko64 lseek64 \
+ pformat printf snprintf snwprintf sprintf vfprintf vfscanf vfwscanf vprintf \
+ vscanf vsnprintf vsnwprintf vsprintf vsscanf vswscanf vwscanf)
# pformat.$(OBJEXT) needs an explicit build rule, since we need to
# specify an additional header file path.
diff --git a/mingwrt/include/stdio.h b/mingwrt/include/stdio.h
index 84ab7b7..1248081 100644
--- a/mingwrt/include/stdio.h
+++ b/mingwrt/include/stdio.h
@@ -159,14 +159,12 @@ __MINGW_IMPORT FILE _iob[]; /* An array of FILE imported from DLL. */
#define stdout (&_iob[STDOUT_FILENO])
#define stderr (&_iob[STDERR_FILENO])
-#ifdef __cplusplus
-extern "C" {
-#endif
+_BEGIN_C_DECLS
/*
* File Operations
*/
-_CRTIMP FILE* __cdecl __MINGW_NOTHROW fopen (const char*, const char*);
+_CRTIMP FILE* __cdecl __MINGW_NOTHROW fopen (const char*, const char*);
_CRTIMP FILE* __cdecl __MINGW_NOTHROW freopen (const char*, const char*, FILE*);
_CRTIMP int __cdecl __MINGW_NOTHROW fflush (FILE*);
_CRTIMP int __cdecl __MINGW_NOTHROW fclose (FILE*);
@@ -314,7 +312,7 @@ _CRTIMP int __mingw_stdio_redirect__(vsprintf)(char*, const char*, __VALIST);
#undef __mingw_stdio_redirect__
-/* The following pair ALWAYS refer to the MSVCRT implementations...
+/* The following three ALWAYS refer to the MSVCRT implementations...
*/
_CRTIMP int __cdecl __MINGW_NOTHROW _snprintf (char*, size_t, const char*, ...);
_CRTIMP int __cdecl __MINGW_NOTHROW _vsnprintf (char*, size_t, const char*, __VALIST);
@@ -598,10 +596,9 @@ _CRTIMP int __cdecl __MINGW_NOTHROW fileno (FILE*);
#if defined (__MSVCRT__) && !defined (__NO_MINGW_LFS)
#include <sys/types.h>
-__CRT_INLINE FILE* __cdecl __MINGW_NOTHROW fopen64 (const char* filename, const char* mode)
-{
- return fopen (filename, mode);
-}
+__CRT_INLINE __JMPSTUB__(( FUNCTION = fopen64, REMAPPED = fopen ))
+FILE* __cdecl __MINGW_NOTHROW fopen64 (const char* filename, const char* mode)
+{ return fopen (filename, mode); }
int __cdecl __MINGW_NOTHROW fseeko64 (FILE*, off64_t, int);
@@ -610,7 +607,8 @@ int __cdecl __MINGW_NOTHROW __mingw_fseeko64 (FILE *, off64_t, int);
#define fseeko64(fp, offset, whence) __mingw_fseeko64(fp, offset, whence)
#endif
-__CRT_INLINE off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE * stream)
+__CRT_INLINE __LIBIMPL__(( FUNCTION = ftello64 ))
+off64_t __cdecl __MINGW_NOTHROW ftello64 (FILE * stream)
{
fpos_t pos;
if (fgetpos(stream, &pos))
@@ -709,10 +707,7 @@ _CRTIMP int __cdecl __MINGW_NOTHROW putw (int, FILE*);
#endif /* __STRICT_ANSI */
-#ifdef __cplusplus
-}
-#endif
+_END_C_DECLS
#endif /* Not RC_INVOKED */
-
#endif /* _STDIO_H_ */
diff --git a/mingwrt/mingwex/stdio/fopen64.c b/mingwrt/mingwex/stdio/fopen64.c
deleted file mode 100644
index d1dca88..0000000
--- a/mingwrt/mingwex/stdio/fopen64.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <stdio.h>
-
-FILE* __cdecl
-fopen64 (const char* filename, const char* mode)
-{
- return fopen (filename, mode);
-}
diff --git a/mingwrt/mingwex/stdio/ftello64.c b/mingwrt/mingwex/stdio/ftello64.c
deleted file mode 100644
index 97a388c..0000000
--- a/mingwrt/mingwex/stdio/ftello64.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-
-off64_t __cdecl
-ftello64 (FILE * stream)
-{
- fpos_t pos;
- if (fgetpos(stream, &pos))
- return -1LL;
- else
- return ((off64_t) pos);
-}
https://sf.net/p/mingw/mingw-org-wsl/ci/5fe775d1a06f8abccfec9b204c3091a447294556/
commit 5fe775d1a06f8abccfec9b204c3091a447294556
Author: Keith Marshall <kei...@us...>
Date: Thu Dec 11 09:58:09 2014 +0000
Don't implicitly define _POSIX_C_SOURCE too early.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index fdd024e..cbc429d 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,11 @@
+2014-12-11 Keith Marshall <kei...@us...>
+
+ Don't implicitly define _POSIX_C_SOURCE too early.
+
+ * include/_mingw.h (_POSIX_C_SOURCE): Delay implict definition.
+ (__USE_MINGW_ANSI_STDIO): This must be initialized first, to ensure
+ that it is not accidentally activated by implied _POSIX_C_SOURCE.
+
2014-12-10 Keith Marshall <kei...@us...>
Correct complex arcsin computation per issue [#2245].
diff --git a/mingwrt/include/_mingw.h b/mingwrt/include/_mingw.h
index 4c101eb..8d50363 100644
--- a/mingwrt/include/_mingw.h
+++ b/mingwrt/include/_mingw.h
@@ -132,54 +132,6 @@
#define __MINGW_LC_ENVVARS__ 0x0000000000000040ULL
-#ifndef _POSIX_C_SOURCE
- /*
- * Users may define this, either directly or indirectly, to explicitly
- * enable a particular level of visibility for the subset of those POSIX
- * features which are supported by MinGW; (notice that this offers no
- * guarantee that any particular POSIX feature will be supported).
- */
-# if defined _XOPEN_SOURCE
- /*
- * Specifying this is the preferred method for setting _POSIX_C_SOURCE;
- * (POSIX defines an explicit relationship to _XOPEN_SOURCE). Note that
- * any such explicit setting will augment the set of features which are
- * available to any compilation unit, even if it seeks to be strictly
- * ANSI-C compliant.
- */
-# if _XOPEN_SOURCE < 500
-# define _POSIX_C_SOURCE 1L /* POSIX.1-1990 / SUSv1 */
-
-# elif _XOPEN_SOURCE < 600
-# define _POSIX_C_SOURCE 199506L /* POSIX.1-1996 / SUSv2 */
-
-# elif _XOPEN_SOURCE < 700
-# define _POSIX_C_SOURCE 200112L /* POSIX.1-2001 / SUSv3 */
-
-# else
-# define _POSIX_C_SOURCE 200809L /* POSIX.1-2008 / SUSv4 */
-# endif
-
-# elif defined _GNU_SOURCE || defined _BSD_SOURCE || ! defined __STRICT_ANSI__
- /*
- * No explicit level of support has been specified; implicitly grant
- * the most comprehensive level to any compilation unit which requests
- * either GNU or BSD feature support, or does not seek to be strictly
- * ANSI-C compliant.
- */
-# define _POSIX_C_SOURCE 200809L
-
-# elif defined _POSIX_SOURCE
- /*
- * Now formally deprecated by POSIX, some old code may specify this;
- * it will enable a minimal level of POSIX support, in addition to the
- * limited feature set enabled for strict ANSI-C conformity.
- */
-# define _POSIX_C_SOURCE 1L
-# endif
-#endif
-
-
/* Try to avoid problems with outdated checks for GCC __attribute__ support.
*/
#undef __attribute__
@@ -396,7 +348,9 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */
*/
#ifndef __USE_MINGW_ANSI_STDIO
/*
- * If user didn't specify it explicitly...
+ * We must check this BEFORE we specifiy any implicit _POSIX_C_SOURCE,
+ * otherwise we would always implicitly choose __USE_MINGW_ANSI_STDIO;
+ * if user didn't specify it explicitly...
*/
# if defined __STRICT_ANSI__ || defined _ISOC99_SOURCE \
|| defined _POSIX_SOURCE || defined _POSIX_C_SOURCE \
@@ -409,13 +363,60 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */
*/
# define __USE_MINGW_ANSI_STDIO 1
# else
- /*
- * otherwise use whatever __MINGW_FEATURES__ specifies...
+ /* otherwise use whatever __MINGW_FEATURES__ specifies...
*/
# define __USE_MINGW_ANSI_STDIO (__MINGW_FEATURES__ & __MINGW_ANSI_STDIO__)
# endif
#endif
+#ifndef _POSIX_C_SOURCE
+ /*
+ * Users may define this, either directly or indirectly, to explicitly
+ * enable a particular level of visibility for the subset of those POSIX
+ * features which are supported by MinGW; (notice that this offers no
+ * guarantee that any particular POSIX feature will be supported).
+ */
+# if defined _XOPEN_SOURCE
+ /*
+ * Specifying this is the preferred method for setting _POSIX_C_SOURCE;
+ * (POSIX defines an explicit relationship to _XOPEN_SOURCE). Note that
+ * any such explicit setting will augment the set of features which are
+ * available to any compilation unit, even if it seeks to be strictly
+ * ANSI-C compliant.
+ */
+# if _XOPEN_SOURCE < 500
+# define _POSIX_C_SOURCE 1L /* POSIX.1-1990 / SUSv1 */
+
+# elif _XOPEN_SOURCE < 600
+# define _POSIX_C_SOURCE 199506L /* POSIX.1-1996 / SUSv2 */
+
+# elif _XOPEN_SOURCE < 700
+# define _POSIX_C_SOURCE 200112L /* POSIX.1-2001 / SUSv3 */
+
+# else
+# define _POSIX_C_SOURCE 200809L /* POSIX.1-2008 / SUSv4 */
+# endif
+
+# elif defined _GNU_SOURCE || defined _BSD_SOURCE || ! defined __STRICT_ANSI__
+ /*
+ * No explicit level of support has been specified; implicitly grant
+ * the most comprehensive level to any compilation unit which requests
+ * either GNU or BSD feature support, or does not seek to be strictly
+ * ANSI-C compliant.
+ */
+# define _POSIX_C_SOURCE 200809L
+
+# elif defined _POSIX_SOURCE
+ /*
+ * Now formally deprecated by POSIX, some old code may specify this;
+ * it will enable a minimal level of POSIX support, in addition to the
+ * limited feature set enabled for strict ANSI-C conformity.
+ */
+# define _POSIX_C_SOURCE 1L
+# endif
+#endif
+
+
/* Only Microsoft could attempt to justify this insanity: when building
* a UTF-16LE application -- apparently their understanding of Unicode is
* limited to this -- the C/C++ runtime requires that the user must define
https://sf.net/p/mingw/mingw-org-wsl/ci/784739f5bb675ac1cc9103606e487735aac1ae3b/
commit 784739f5bb675ac1cc9103606e487735aac1ae3b
Author: Keith Marshall <kei...@us...>
Date: Wed Dec 10 21:27:43 2014 +0000
Correct complex arcsin computation per issue [#2245].
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 1416f55..fdd024e 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,13 @@
2014-12-10 Keith Marshall <kei...@us...>
+ Correct complex arcsin computation per issue [#2245].
+
+ * mingwex/complex/casin_generic.c: New file; it replaces...
+ * mingwex/complex/casin.c: ...this; it is now obsolete; delete it.
+ * mingwex/complex/casinf.c mingwex/complex/casinl: Likewise.
+
+2014-12-10 Keith Marshall <kei...@us...>
+
Correct complex square root computation per issue [#2246].
* include/math.h (hypotf): Redirect __CRT_INLINE call to...
diff --git a/mingwrt/mingwex/complex/casin.c b/mingwrt/mingwex/complex/casin.c
deleted file mode 100644
index 7b833ba..0000000
--- a/mingwrt/mingwex/complex/casin.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- casin.c
- Contributed by Danny Smith
- 2003-10-20
-*/
-
-#include <math.h>
-#include <complex.h>
-
-/* casin (Z ) = -I * clog(I * Z + csqrt (1.0 - Z * Z))) */
-
-double complex casin (double complex Z)
-{
- double complex Res;
- double x, y;
-
- x = __real__ Z;
- y = __imag__ Z;
-
- if (y == 0.0)
- {
- __real__ Res = asin (x);
- __imag__ Res = 0.0;
- }
- else /* -I * clog(I * Z + csqrt(1.0 - Z * Z))) */
- {
- double complex ZZ;
-
- /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */
- /* calculate 1 - Z * Z */
- __real__ ZZ = 1.0 - (x - y) * (x + y);
- __imag__ ZZ = -2.0 * x * y;
- ZZ = csqrt (ZZ);
-
-
- /* add I * Z to ZZ */
-
- __real__ ZZ -= y;
- __imag__ ZZ += x;
-
- ZZ = clog (ZZ);
-
- /* mult by -I */
- __real__ Res = __imag__ ZZ;
- __imag__ Res = - __real__ ZZ;
- }
- return (Res);
-}
diff --git a/mingwrt/mingwex/complex/casin_generic.c b/mingwrt/mingwex/complex/casin_generic.c
new file mode 100644
index 0000000..602fd1b
--- /dev/null
+++ b/mingwrt/mingwex/complex/casin_generic.c
@@ -0,0 +1,159 @@
+/*
+ * casin_generic.c
+ *
+ * $Id$
+ *
+ * Compute the complex arcsin corresponding to a complex sine value;
+ * a generic implementation for casin(), casinf(), and casinl().
+ *
+ * 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 casin(), casinl(),
+ * and casinh() functions; each is to be compiled separately, i.e.
+ *
+ * gcc -D FUNCTION=casin -o casin.o casin_generic.c
+ * gcc -D FUNCTION=casinl -o casinl.o casin_generic.c
+ * gcc -D FUNCTION=casinf -o casinf.o casin_generic.c
+ *
+ */
+#include <math.h>
+#include <complex.h>
+
+#ifndef FUNCTION
+/* If user neglected to specify it, the default compilation is for
+ * the casin() function.
+ */
+# define FUNCTION casin
+#endif
+
+#define argtype_casin double
+#define argtype_casinl long double
+#define argtype_casinf 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_casin(VALUE) VALUE
+#define argcast_casinl(VALUE) PASTE(VALUE,L)
+#define argcast_casinf(VALUE) PASTE(VALUE,F)
+
+#define mapfunc(NAME) mapname(mapfunc_,FUNCTION)(NAME)
+
+#define mapfunc_casin(NAME) NAME
+#define mapfunc_casinl(NAME) PASTE(NAME,l)
+#define mapfunc_casinf(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 compute the arcsin value...
+ */
+ if( (y == ARGCAST(0.0)) && (ARGCAST(1.0) >= mapfunc(fabs)(x)) )
+ {
+ /* ...but when Z is entirely real, and lies within the valid
+ * domain, (-1.0 .. +1.0), for real sine values, we may simply
+ * optimize this call, using the real arcsin function...
+ */
+ __real__ Z = mapfunc(asin)(x);
+ }
+ else
+ { /* Z is complex, (i.e. it has a non-zero imaginary part), or it
+ * is entirely real but lies outside the valid domain for a real
+ * sine value; we must evaluate the complex arcsin expression:
+ *
+ * casin(Z) = -i * clog(i * Z + csqrt(1.0 - Z * Z))
+ *
+ * Here, we use a local accumulator for the evaluation:
+ */
+ ARGTYPE(FUNCTION) complex ZZ;
+
+ /* First, note that we may express 1.0 - Z * Z as equivalent to
+ * 1.0 - (x + iy) * (x + iy), which expands to:
+ *
+ * 1.0 - (x * x + i * y * i * y + 2.0 * i * x * y)
+ *
+ * and, noting that i * i is equivalent to -1, this simplifies
+ * to become:
+ *
+ * 1.0 - (x * x - y * y + 2.0 * i * x * y)
+ *
+ * Separating real and imaginary parts yields:
+ *
+ * (1.0 - x * x - y * y) - (i * 2.0 * x * y)
+ *
+ * and factorization of the real part then yields:
+ *
+ * (1.0 - (x - y) * (x + y)) - (i * 2.0 * x * y)
+ *
+ * hence...
+ */
+ __real__ ZZ = ARGCAST(1.0) - (x - y) * (x + y);
+ __imag__ ZZ = ARGCAST(-2.0) * x * y;
+
+ /* ...and the complex square root term may be computed as...
+ */
+ ZZ = mapfunc(csqrt)(ZZ);
+
+ /* ...to which we then add i * (x + iy), (i.e. i times the
+ * original value of Z); here, we note that i * iy is equal to
+ * -1 * y, and hence adding it is equivalent to subtracting y
+ * from the real part of our recomputed Z, while adding i * x
+ * is equivalent to adding x to the imaginary part...
+ */
+ __real__ ZZ -= y;
+ __imag__ ZZ += x;
+
+ /* ...thus obtaining the intermediate expression value from
+ * which we must compute the complex logarithm...
+ */
+ ZZ = mapfunc(clog)(ZZ);
+
+ /* ...and ultimately, the arcsin value to be returned is the
+ * value of this complex logarithm multiplied by -1 * i; (the
+ * imaginary part of the intermediate result, multiplied by i
+ * becomes the real part of the result, with inverted sign,
+ * which is then inverted again on multiplication by -1...
+ */
+ __real__ Z = __imag__ ZZ;
+
+ /* ...while the real part of the intermediate simply becomes
+ * the imaginary part of the result, with sign preserved, but
+ * then inverted by multiplication by -1).
+ */
+ __imag__ Z = ARGCAST(-1.0) * __real__ ZZ;
+ }
+ return Z;
+}
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/complex/casinf.c b/mingwrt/mingwex/complex/casinf.c
deleted file mode 100644
index ffe4788..0000000
--- a/mingwrt/mingwex/complex/casinf.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- casinf.c
- Contributed by Danny Smith
- 2004-12-24
-*/
-
-#include <math.h>
-#include <complex.h>
-
-/* casin (Z ) = -I * clog(I * Z + csqrt (1.0 - Z * Z))) */
-
-float complex casinf (float complex Z)
-{
- float complex Res;
- float x, y;
-
- x = __real__ Z;
- y = __imag__ Z;
-
- if (y == 0.0f)
- {
- __real__ Res = asinf (x);
- __imag__ Res = 0.0f;
- }
- else /* -I * clog(I * Z + csqrt(1.0 - Z * Z))) */
- {
- float complex ZZ;
-
- /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */
- /* calculate 1 - Z * Z */
- __real__ ZZ = 1.0f - (x - y) * (x + y);
- __imag__ ZZ = -2.0f * x * y;
- ZZ = csqrtf (ZZ);
-
-
- /* add I * Z to ZZ */
-
- __real__ ZZ -= y;
- __imag__ ZZ += x;
-
- ZZ = clogf (ZZ);
-
- /* mult by -I */
- __real__ Res = __imag__ ZZ;
- __imag__ Res = - __real__ ZZ;
- }
- return (Res);
-}
diff --git a/mingwrt/mingwex/complex/casinl.c b/mingwrt/mingwex/complex/casinl.c
deleted file mode 100644
index c6544a6..0000000
--- a/mingwrt/mingwex/complex/casinl.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- casinl.c
- Contributed by Danny Smith
- 2005-01-04
-*/
-
-#include <math.h>
-#include <complex.h>
-
-/* casin (Z ) = -I * clog(I * Z + csqrt (1.0 - Z * Z))) */
-
-long double complex casinl (long double complex Z)
-{
- long double complex Res;
- long double x, y;
-
- x = __real__ Z;
- y = __imag__ Z;
-
- if (y == 0.0L)
- {
- __real__ Res = asinl (x);
- __imag__ Res = 0.0L;
- }
- else /* -I * clog(I * Z + csqrt(1.0 - Z * Z))) */
- {
- long double complex ZZ;
-
- /* Z * Z = ((x - y) * (x + y)) + (2.0 * x * y) * I */
- /* calculate 1 - Z * Z */
- __real__ ZZ = 1.0L - (x - y) * (x + y);
- __imag__ ZZ = -2.0L * x * y;
- ZZ = csqrtl (ZZ);
-
-
- /* add I * Z to ZZ */
-
- __real__ ZZ -= y;
- __imag__ ZZ += x;
-
- ZZ = clogl (ZZ);
-
- /* mult by -I */
- __real__ Res = __imag__ ZZ;
- __imag__ Res = - __real__ ZZ;
- }
- return (Res);
-}
https://sf.net/p/mingw/mingw-org-wsl/ci/8cd2522438079d26ab866d7c04b896b50db7bdb1/
commit 8cd2522438079d26ab866d7c04b896b50db7bdb1
Author: Keith Marshall <kei...@us...>
Date: Wed Dec 10 21:21:17 2014 +0000
Correct complex square root computation per issue [#2246].
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index b0f54c8..1416f55 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,5 +1,17 @@
2014-12-10 Keith Marshall <kei...@us...>
+ Correct complex square root computation per issue [#2246].
+
+ * include/math.h (hypotf): Redirect __CRT_INLINE call to...
+ (_hypot): ...this MSVCRT.DLL exported function, so avoiding...
+ (hypot): ...this libmoldname.a indirection.
+
+ * mingwex/complex/csqrt_generic.c: New file; it replaces...
+ * mingwex/complex/csqrt.c: ...this; it is now obsolete; delete it.
+ * mingwex/complex/csqrtf.c mingwex/complex/csqrtl: Likewise.
+
+2014-12-10 Keith Marshall <kei...@us...>
+
Adjust header guards to resolve issue [#2244].
* include/_mingw.h (_POSIX_C_SOURCE): Define it implicitly...
diff --git a/mingwrt/include/math.h b/mingwrt/include/math.h
index c5c99b3..5f5f28e 100644
--- a/mingwrt/include/math.h
+++ b/mingwrt/include/math.h
@@ -632,7 +632,7 @@ 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);}
+{ return (float)(_hypot (x, y)); }
#endif
extern long double __cdecl hypotl (long double, long double);
diff --git a/mingwrt/mingwex/complex/csqrt.c b/mingwrt/mingwex/complex/csqrt.c
deleted file mode 100644
index 797ea0a..0000000
--- a/mingwrt/mingwex/complex/csqrt.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- csqrt.c
- Contributed by Danny Smith
- 2003-10-20
-*/
-
-#include <math.h>
-#include <complex.h>
-
-double complex csqrt (double complex Z)
-{
- double complex Res;
- double t;
- double x = __real__ Z;
- double y = __imag__ Z;
-
- if (y == 0.0)
- {
- if (x < 0.0)
- {
- __real__ Res = 0.0;
- __imag__ Res = sqrt (-x);
- }
- else
- {
- __real__ Res = sqrt (x);
- __imag__ Res = 0.0;
- }
- }
-
- else if (x == 0.0)
- {
- t = sqrt(0.5 * fabs (y));
- __real__ Res = t;
- __imag__ Res = y > 0 ? t : -t;
- }
-
- else
- {
- t = sqrt (2.0 * (_hypot (x, y) + fabs (x)));
- double u = t / 2.0;
- if ( x > 0.0)
- {
- __real__ Res = u;
- __imag__ Res = y / t;
- }
- else
- {
- __real__ Res = fabs ( y / t);
- __imag__ Res = y < 0.0 ? -u : u;
- }
- }
-
- return Res;
-}
-
diff --git a/mingwrt/mingwex/complex/csqrt_generic.c b/mingwrt/mingwex/complex/csqrt_generic.c
new file mode 100644
index 0000000..87ffd83
--- /dev/null
+++ b/mingwrt/mingwex/complex/csqrt_generic.c
@@ -0,0 +1,216 @@
+/*
+ * csqrt_generic.c
+ *
+ * $Id$
+ *
+ * Compute the complex arcsin corresponding to a complex sine value;
+ * a generic implementation for casin(), casinf(), and casinl().
+ *
+ * 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 csqrt(), csqrtl(),
+ * and csqrth() functions; each is to be compiled separately, i.e.
+ *
+ * gcc -D FUNCTION=csqrt -o csqrt.o csqrt_generic.c
+ * gcc -D FUNCTION=csqrtl -o csqrtl.o csqrt_generic.c
+ * gcc -D FUNCTION=csqrtf -o csqrtf.o csqrt_generic.c
+ *
+ */
+#include <math.h>
+#include <complex.h>
+
+#ifndef FUNCTION
+/* If user neglected to specify it, the default compilation is for
+ * the csqrt() function.
+ */
+# define FUNCTION csqrt
+#endif
+
+#define argtype_csqrt double
+#define argtype_csqrtl long double
+#define argtype_csqrtf 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_csqrt(VALUE) VALUE
+#define argcast_csqrtl(VALUE) PASTE(VALUE,L)
+#define argcast_csqrtf(VALUE) PASTE(VALUE,F)
+
+#define mapfunc(NAME) mapname(mapfunc_,FUNCTION)(NAME)
+
+#define mapfunc_csqrt(NAME) NAME
+#define mapfunc_csqrtl(NAME) PASTE(NAME,l)
+#define mapfunc_csqrtf(NAME) PASTE(NAME,f)
+
+/* Prefer fast versions of mathematical functions.
+ */
+#include "../math/fastmath.h"
+
+#define log __fast_log
+#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 )
+{
+ /* Compute the principal square root of complex number Z, which we
+ * consider to be represented in the cartesian form, Z = x + iy
+ */
+ ARGTYPE(FUNCTION) x = __real__ Z;
+ ARGTYPE(FUNCTION) y = __imag__ Z;
+
+ /* Now, we may recompute the value of Z, such that it will become
+ * the principal square root of x + iy; let's call it a + ib. Thus,
+ * in the general case, we may state that:
+ *
+ * (a + ib) * (a + ib) = x + iy (1)
+ *
+ * which may be expanded to:
+ *
+ * a^2 + i^2 * b^2 + 2 * a * b * i = x + iy (2)
+ *
+ * or, since i^2 == -1, (by definition):
+ *
+ * a^2 - b^2 + 2abi = x + iy (3)
+ *
+ * Comparing real and imaginary parts of LHS and RHS, we may
+ * deduce the following pair of simultaneous equations:
+ *
+ * a^2 - b^2 = x (4)
+ * 2ab = y (5)
+ *
+ * Rearranging (5), and substituting to eliminate b from (4),
+ * we deduce that:
+ *
+ * a^2 - (y / 2a)^2 = x (6)
+ *
+ * or, expanding and rearranging:
+ *
+ * 4a^2 * a^2 - 4a^2 * x = y^2 (7)
+ *
+ * which, since x and y are known, is quadratic in a^2:
+ *
+ * (a^2)^2 - x * a^2 = y^2 / 4 (8)
+ *
+ * Completing the square on the LHS, and adjusting the RHS to
+ * preserve equality:
+ *
+ * (a^2)^2 - x * a^2 + x^2 / 4 = y^2 / 4 + x^2 / 4 (9)
+ *
+ * Factorizing, and solving for a^2:
+ *
+ * (a^2 - x / 2)^2 = (y^2 + x^2) / 4 (10)
+ *
+ * hence:
+ *
+ * a^2 = sqrt(y^2 + x^2) / 2 + x / 2 (11)
+ *
+ * and further, taking the principal (positive) square root yields the
+ * general expression for the real part of the complex square root:
+ *
+ * a = sqrt((sqrt(y^2 + x^2) + x) / 2) (12)
+ *
+ * Having calculated this real part, we may back-substitute into (5),
+ * rearranged to yield the imaginary part:
+ *
+ * b = y / (2 * a) (13)
+ *
+ *
+ * The preceding analysis applies in the general case; however...
+ */
+ if( y == ARGCAST(0.0) )
+ {
+ /* ...in the special case where Z has no imaginary part, (i.e.
+ * y == 0, and Z is entirely real)...
+ */
+ if( x < ARGCAST(0.0) )
+ {
+ /* ...and when Z represents a negative real number, then it
+ * follows from (12) that the real part of its square root is
+ * zero, (since we always take positive square root terms)...
+ */
+ __real__ Z = ARGCAST(0.0);
+
+ /* ...but the solution of (13) then becomes indeterminate, so
+ * we must deduce the imaginary result by rearrangement of (4),
+ * adopting the convention whereby the sign of the signed zero
+ * defining the imaginary part of Z is preserved...
+ */
+ __imag__ Z = mapfunc(copysign)(mapfunc(sqrt)(-x), y);
+ }
+ else
+ { /* ...whilst in the case where Z represents a positive real
+ * number, we simply set the real part of the result as the
+ * positive square root of x, leaving the imaginary part as
+ * the unchanged signed zero value of y; (result following
+ * directly from (12) and (13)).
+ */
+ __real__ Z = mapfunc(sqrt)(x);
+ }
+ }
+ else if( x == ARGCAST(0.0) )
+ {
+ /* This is a further special case, in which Z represents an
+ * entirely imaginary number, (with no real part). Here, we
+ * could apply (12) and (13); however, the knowledge that x is
+ * zero allows us to employ a simplified derivation from (12)
+ * to compute the real part of the principal square root...
+ */
+ __real__ Z = x = mapfunc(sqrt)(ARGCAST(0.5) * mapfunc(fabs)(y));
+
+ /* ...while we may deduce from (4) that the imaginary part is
+ * numerically equal to the real part, and once again we adopt
+ * the convention of preserving the sign of y, in the result,
+ * (as is required to satisfy (13)).
+ */
+ __imag__ Z = mapfunc(copysign)(x, y);
+ }
+ 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).
+ */
+ __real__ Z = x = mapfunc(sqrt)(ARGCAST(0.5) * (mapfunc(_hypot)(x, y) + x));
+ __imag__ Z = ARGCAST(0.5) * y / x;
+ }
+ return Z;
+}
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/complex/csqrtf.c b/mingwrt/mingwex/complex/csqrtf.c
deleted file mode 100644
index eb2a388..0000000
--- a/mingwrt/mingwex/complex/csqrtf.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <math.h>
-#include <complex.h>
-
-float complex csqrtf (float complex Z)
-{
- float complex Res;
- float r;
- float x = __real__ Z;
- float y = __imag__ Z;
-
- if (y == 0.0f)
- {
- if (x < 0.0f)
- {
- __real__ Res = 0.0f;
- __imag__ Res = sqrtf (-x);
- }
- else
- {
- __real__ Res = sqrtf (x);
- __imag__ Res = 0.0f;
- }
- }
-
- else if (x == 0.0f)
- {
- r = sqrtf(0.5f * fabsf (y));
- __real__ Res = r;
- __imag__ Res = y > 0 ? r : -r;
- }
-
- else
- {
- float t = sqrtf (2 * (_hypot (__real__ Z, __imag__ Z) + fabsf (x)));
- float u = t / 2.0f;
- if ( x > 0.0f)
- {
- __real__ Res = u;
- __imag__ Res = y / t;
- }
- else
- {
- __real__ Res = fabsf (y / t);
- __imag__ Res = y < 0 ? -u : u;
- }
- }
-
- return Res;
-}
diff --git a/mingwrt/mingwex/complex/csqrtl.c b/mingwrt/mingwex/complex/csqrtl.c
deleted file mode 100644
index 58ed9c4..0000000
--- a/mingwrt/mingwex/complex/csqrtl.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/* csqrtl.c */
-/*
- Contributed by Danny Smith
- 2005-01-04
-*/
-
-#include <math.h>
-#include <complex.h>
-
-long double complex csqrtl (long double complex Z)
-{
- long double complex Res;
- long double r;
- long double x = __real__ Z;
- long double y = __imag__ Z;
-
- if (y == 0.0L)
- {
- if (x < 0.0L)
- {
- __real__ Res = 0.0L;
- __imag__ Res = sqrtl (-x);
- }
- else
- {
- __real__ Res = sqrtl (x);
- __imag__ Res = 0.0L;
- }
- }
-
- else if (x == 0.0L)
- {
- r = sqrtl(0.5L * fabsl (y));
- __real__ Res = r;
- __imag__ Res = y > 0 ? r : -r;
- }
-
- else
- {
- long double t = sqrtl (2.0L * (hypotl (__real__ Z, __imag__ Z) + fabsl (x)));
- long double u = t / 2.0L;
- if ( x > 0.0L)
- {
- __real__ Res = u;
- __imag__ Res = y / t;
- }
- else
- {
- __real__ Res = fabsl (y / t);
- __imag__ Res = y < 0 ? -u : u;
- }
- }
-
- return Res;
-}
https://sf.net/p/mingw/mingw-org-wsl/ci/60ca03220cdd2b56a5323e64c1ce375fcd5387c2/
commit 60ca03220cdd2b56a5323e64c1ce375fcd5387c2
Author: Keith Marshall <kei...@us...>
Date: Wed Dec 10 14:43:36 2014 +0000
Adjust header guards to resolve issue [#2244].
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index b53f32d..b0f54c8 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,17 @@
+2014-12-10 Keith Marshall <kei...@us...>
+
+ Adjust header guards to resolve issue [#2244].
+
+ * include/_mingw.h (_POSIX_C_SOURCE): Define it implicitly...
+ [_GNU_SOURCE || _BSD_SOURCE || _POSIX_SOURCE || !__STRICT_ANSI__]:
+ ...when any of these prevail, or as appropriate to correspond with...
+ [_XOPEN_SOURCE]: ...this; set conformance level accordingly.
+
+ * include/math.h [_POSIX_C_SOURCE || defined _USE_MATH_DEFINES]
+ (M_E, M_LOG2E, M_LOG10E, M_LN2, M_LN10, M_PI, M_PI_2, M_PI_4, M_1_PI)
+ (M_2_PI, M_2_SQRTPI, M_SQRT2, M_SQRT1_2): Define them, irrespective...
+ [__STRICT_ANSI__]: ...of this; replace guard accordingly.
+
2014-12-01 Keith Marshall <kei...@us...>
Add implementation of mkstemp() and mkdtemp() functions.
diff --git a/mingwrt/include/_mingw.h b/mingwrt/include/_mingw.h
index cbaf9d0..4c101eb 100644
--- a/mingwrt/include/_mingw.h
+++ b/mingwrt/include/_mingw.h
@@ -131,7 +131,57 @@
#define __MINGW_LC_MESSAGES__ 0x0000000000000010ULL
#define __MINGW_LC_ENVVARS__ 0x0000000000000040ULL
-/* Try to avoid problems with outdated checks for GCC __attribute__ support. */
+
+#ifndef _POSIX_C_SOURCE
+ /*
+ * Users may define this, either directly or indirectly, to explicitly
+ * enable a particular level of visibility for the subset of those POSIX
+ * features which are supported by MinGW; (notice that this offers no
+ * guarantee that any particular POSIX feature will be supported).
+ */
+# if defined _XOPEN_SOURCE
+ /*
+ * Specifying this is the preferred method for setting _POSIX_C_SOURCE;
+ * (POSIX defines an explicit relationship to _XOPEN_SOURCE). Note that
+ * any such explicit setting will augment the set of features which are
+ * available to any compilation unit, even if it seeks to be strictly
+ * ANSI-C compliant.
+ */
+# if _XOPEN_SOURCE < 500
+# define _POSIX_C_SOURCE 1L /* POSIX.1-1990 / SUSv1 */
+
+# elif _XOPEN_SOURCE < 600
+# define _POSIX_C_SOURCE 199506L /* POSIX.1-1996 / SUSv2 */
+
+# elif _XOPEN_SOURCE < 700
+# define _POSIX_C_SOURCE 200112L /* POSIX.1-2001 / SUSv3 */
+
+# else
+# define _POSIX_C_SOURCE 200809L /* POSIX.1-2008 / SUSv4 */
+# endif
+
+# elif defined _GNU_SOURCE || defined _BSD_SOURCE || ! defined __STRICT_ANSI__
+ /*
+ * No explicit level of support has been specified; implicitly grant
+ * the most comprehensive level to any compilation unit which requests
+ * either GNU or BSD feature support, or does not seek to be strictly
+ * ANSI-C compliant.
+ */
+# define _POSIX_C_SOURCE 200809L
+
+# elif defined _POSIX_SOURCE
+ /*
+ * Now formally deprecated by POSIX, some old code may specify this;
+ * it will enable a minimal level of POSIX support, in addition to the
+ * limited feature set enabled for strict ANSI-C conformity.
+ */
+# define _POSIX_C_SOURCE 1L
+# endif
+#endif
+
+
+/* Try to avoid problems with outdated checks for GCC __attribute__ support.
+ */
#undef __attribute__
#if defined (__PCC__)
diff --git a/mingwrt/include/math.h b/mingwrt/include/math.h
index 05e69d3..c5c99b3 100644
--- a/mingwrt/include/math.h
+++ b/mingwrt/include/math.h
@@ -48,10 +48,15 @@
#endif /* Not __STRICT_ANSI__ */
-/* Traditional/XOPEN math constants (double precison) */
-#ifndef __STRICT_ANSI__
+#if _POSIX_C_SOURCE || defined _USE_MATH_DEFINES
+/*
+ * Traditional/XOPEN math constants (double precison). MSVC makes these
+ * available, only if _USE_MATH_DEFINES is specified; POSIX does so also,
+ * when _POSIX_C_SOURCE is defined and non-zero, (as will be the case by
+ * default in MinGW, unless __STRICT_ANSI__ checking is in effect).
+ */
#define M_E 2.7182818284590452354
-#define M_LOG2E 1.4426950408889634074
+#define M_LOG2E 1.4426950408889634074
#define M_LOG10E 0.43429448190325182765
#define M_LN2 0.69314718055994530942
#define M_LN10 2.30258509299404568402
@@ -61,7 +66,7 @@
#define M_1_PI 0.31830988618379067154
#define M_2_PI 0.63661977236758134308
#define M_2_SQRTPI 1.12837916709551257390
-#define M_SQRT2 1.41421356237309504880
+#define M_SQRT2 1.41421356237309504880
#define M_SQRT1_2 0.70710678118654752440
#endif
https://sf.net/p/mingw/mingw-org-wsl/ci/c5bb88dcc205216c28fdd31dcaea1ae039ab480c/
commit c5bb88dcc205216c28fdd31dcaea1ae039ab480c
Author: Keith Marshall <kei...@us...>
Date: Tue Dec 9 10:39:45 2014 +0000
Layout and documentary corrections.
diff --git a/mingwrt/mingwex/math/asinh_generic.c b/mingwrt/mingwex/math/asinh_generic.c
index f892997..333758f 100644
--- a/mingwrt/mingwex/math/asinh_generic.c
+++ b/mingwrt/mingwex/math/asinh_generic.c
@@ -1,6 +1,14 @@
-/**
- * @file asinh_generic.c
- * Copyright 2012, 2013 MinGW.org project
+/*
+ * asinh_generic.c
+ *
+ * Compute inverse hyberbolic sine; this is a generic implementation for
+ * all of the asinh(), asinhl(), and asinhf() functions.
+ *
+ * $Id$
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * Copyright 2013, 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"),
@@ -22,15 +30,11 @@
* DEALINGS IN THE SOFTWARE.
*
*
- * Implemented 2013 by Keith Marshall <kei...@us...>
- * Copyright assigned by the author to the MinGW.org project.
- *
- * This is a generic implementation for all of the asinh(), asinhl(),
- * and asinhf() functions; each is to be compiled separately, i.e.
+ * This module should be compiled separately for each supported function:
*
- * gcc -D FUNCTION=asinh -o asinh.o asinh.c
- * gcc -D FUNCTION=asinhl -o asinhl.o asinh.c
- * gcc -D FUNCTION=asinhf -o asinhf.o asinh.c
+ * gcc -D FUNCTION=asinh -o asinh.o asinh_generic.c
+ * gcc -D FUNCTION=asinhl -o asinhl.o asinh_generic.c
+ * gcc -D FUNCTION=asinhf -o asinhf.o asinh_generic.c
*
*/
#include <math.h>
@@ -144,3 +148,5 @@ ARGTYPE(FUNCTION) FUNCTION( ARGTYPE(FUNCTION) x )
*/
return x;
}
+
+/* $RCSfile$: end of file */
https://sf.net/p/mingw/mingw-org-wsl/ci/764145b2e3b29f1ac4b8651d8dbaaf5949843d32/
commit 764145b2e3b29f1ac4b8651d8dbaaf5949843d32
Author: Keith Marshall <kei...@us...>
Date: Tue Dec 9 01:00:15 2014 +0000
Minor formatting adjustment.
diff --git a/mingwrt/include/dirent.h b/mingwrt/include/dirent.h
index a31c4aa..b80d33c 100644
--- a/mingwrt/include/dirent.h
+++ b/mingwrt/include/dirent.h
@@ -99,7 +99,7 @@ __CRT_ALIAS __JMPSTUB__(( FUNCTION = _wclosedir ))
int __cdecl __MINGW_NOTHROW _wclosedir (_WDIR *__dir)
{ return __mingw__wclosedir (__dir); }
-__CRT_ALIAS __JMPSTUB__(( FUNCTION = _wrewinddir))
+__CRT_ALIAS __JMPSTUB__(( FUNCTION = _wrewinddir ))
void __cdecl __MINGW_NOTHROW _wrewinddir (_WDIR *__dir)
{ return __mingw__wrewinddir (__dir); }
https://sf.net/p/mingw/mingw-org-wsl/ci/ed7dcf1eb8b2fefb647b45a3f472524bb63fd870/
commit ed7dcf1eb8b2fefb647b45a3f472524bb63fd870
Author: Keith Marshall <kei...@us...>
Date: Mon Dec 1 21:12:27 2014 +0000
Add implementation of mkstemp() and mkdtemp() functions.
diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog
index 7f6df43..b53f32d 100644
--- a/mingwrt/ChangeLog
+++ b/mingwrt/ChangeLog
@@ -1,3 +1,31 @@
+2014-12-01 Keith Marshall <kei...@us...>
+
+ Add implementation of mkstemp() and mkdtemp() functions.
+
+ * mingwex/cryptnam.c: New file; it implements...
+ (__mingw_crypto_tmpname): ...this helper function; it generates a
+ cryptographically secure sequence of characters, used as the random
+ component in temporary file and directory names.
+
+ * mingwex/mkstemp.c: New file; it implements...
+ (__mingw_mkstemp): ...this provider of mkstemp() functionality.
+
+ * mingwex/mkdtemp.c: New file; it implements...
+ (__mingw_mkdtemp): ...this provider of mkdtemp() functionality.
+
+ * include/stdlib.h (mkstemp): Declare protototye; provide an inline
+ function implementation, with LIBIMPL extern semantics, in terms of...
+ (__mingw_mkstemp): ...this; also declare prototype, and define...
+ (_MKSTEMP_INVOKE, _MKSTEMP_DEFAULT): ...these supporting constants.
+ (_MKSTEMP_SETMODE): New macro; define it, also providing...
+ (MKSTEMP_SETMODE) [!_NO_OLDNAMES]: ...this alias.
+ (mkdtemp): Declare prototype; provide inline implementation, with
+ JMPSTUB extern semantics, in terms of...
+ (__mingw_mkdtemp): ...this; declare prototype.
+
+ * Makefile.in (libmingwex.a): Add dependency rule, to include...
+ (mkstemp.$OBJEXT, mkdtemp.$OBJEXT, cryptname.$OBJEXT): ...these.
+
2014-11-30 Keith Marshall <kei...@us...>
More JMPSTUB rationalization of inline functions.
diff --git a/mingwrt/Makefile.in b/mingwrt/Makefile.in
index a711605..36f51af 100644
--- a/mingwrt/Makefile.in
+++ b/mingwrt/Makefile.in
@@ -444,6 +444,7 @@ $(addsuffix fmt.$(OBJEXT),varo crto geto seto crtn getn setn): %.$(OBJEXT): ofmt
#libmingwex.a: $(addsuffix .$(OBJEXT), glob membarrier)
libmingwex.a: $(addsuffix .$(OBJEXT), mingw-aligned-malloc mingw-fseek glob)
libmingwex.a: $(addsuffix .$(OBJEXT), getopt basename dirname ftruncate usleep)
+libmingwex.a: $(addsuffix .$(OBJEXT), mkstemp mkdtemp cryptnam)
libmingwex.a: $(addsuffix .$(OBJEXT), tdelete tfind tsearch twalk)
diff --git a/mingwrt/include/stdlib.h b/mingwrt/include/stdlib.h
index 01fb7a8..71a1b86 100644
--- a/mingwrt/include/stdlib.h
+++ b/mingwrt/include/stdlib.h
@@ -556,9 +556,51 @@ wchar_t* __cdecl __MINGW_NOTHROW ulltow (unsigned long long _n, wchar_t * _w, in
#endif /* __MSVCRT__ */
#endif /* !__NO_ISOCEXT */
+#if !defined __STRICT_ANSI__
+/*
+ * POSIX/BSD extensions in libmingwex.a; maybe these should be exposed only on
+ * the basis of some POSIX or BSD specific feature tests, but for convenience,
+ * we require only !__STRICT_ANSI__
+ *
+ *
+ * mkstemp(3) function support; added per feature request #2003.
+ * POSIX wants _XOPEN_SOURCE >= 500, (implying _POSIX_C_SOURCE >= 200112L),
+ * but, as noted above, we will settle for !__STRICT_ANSI__.
+ */
+int __cdecl __MINGW_NOTHROW mkstemp( char * );
+int __cdecl __MINGW_NOTHROW __mingw_mkstemp( int, char * );
+
+/* The following macros are a MinGW specific extension, to facilite
+ * use of _O_TEMPORARY, (in addition to the POSIX required attributes),
+ * when creating the temporary file. Note that they require fcntl.h,
+ * which stdlib.h should NOT automatically include; we leave the onus
+ * on the user to explicitly include it, if using MKSTEMP_SETMODE.
+ */
+#define _MKSTEMP_INVOKE 0
+#define _MKSTEMP_DEFAULT _O_CREAT | _O_EXCL | _O_RDWR
+#define _MKSTEMP_SETMODE(M) __mingw_mkstemp( _MKSTEMP_DEFAULT | (M), NULL )
+#ifndef _NO_OLDNAMES
+#define MKSTEMP_SETMODE(M) __mingw_mkstemp( _MKSTEMP_DEFAULT | (M), NULL )
#endif
+__CRT_ALIAS __LIBIMPL__(( FUNCTION = mkstemp ))
+int __cdecl __MINGW_NOTHROW mkstemp( char *__filename_template )
+{ return __mingw_mkstemp( _MKSTEMP_INVOKE, __filename_template ); }
+
+/* mkdtemp(3) function support: added as adjunct to feature request #2003.
+ * POSIX wants _XOPEN_SOURCE >= 700, (implying _POSIX_C_SOURCE >= 200809L),
+ * but once again, we will settle for !__STRICT_ANSI__.
+ */
+char * __cdecl __MINGW_NOTHROW mkdtemp( char * );
+char * __cdecl __MINGW_NOTHROW __mingw_mkdtemp( char * );
+
+__CRT_ALIAS __JMPSTUB__(( FUNCTION = mkdtemp ))
+char * __cdecl __MINGW_NOTHROW mkdtemp( char *__dirname_template )
+{ return __mingw_mkdtemp( __dirname_template ); }
+
+#endif /* (!__STRICT_ANSI__) */
+
_END_C_DECLS
#endif /* Not RC_INVOKED */
diff --git a/mingwrt/mingwex/cryptnam.c b/mingwrt/mingwex/cryptnam.c
new file mode 100644
index 0000000..f7f6a0a
--- /dev/null
+++ b/mingwrt/mingwex/cryptnam.c
@@ -0,0 +1,188 @@
+/*
+ * cryptnam.c
+ *
+ * Implementation of a cryptographically secure random character sequence
+ * generator; this is specifically tailored to satisfy the requirement for
+ * replacement of the sequence of six 'XXXXXX's, within the templates for
+ * the file name, or the directory name, in MinGW.org implementations of
+ * the mkstemp(3) and mkdtemp(3) functions, respectively.
+ *
+ * $Id$
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * Copyright (C) 2013, 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.
+ *
+ */
+#define WIN32_LEAN_AND_MEAN
+
+#include <limits.h>
+#include <windows.h>
+#include <wincrypt.h>
+#include <string.h>
+
+#define CRYPTO_INLINE static __inline__ __attribute__((__always_inline__))
+
+CRYPTO_INLINE HCRYPTPROV crypto_provider( void )
+#define RSA_MODE( OPT, FLAG ) PROV_RSA_##OPT, CRYPT_##FLAG
+{
+ /* Helper to establish a cryptographic provider context for the
+ * cryptographically secure random number generator.
+ *
+ * At the outset, this provider requires initialization.
+ */
+ static HCRYPTPROV id = (HCRYPTPROV)(0);
+
+ /* On second, and subsequent calls, it should already have been
+ * initialized...
+ */
+ if( id != (HCRYPTPROV)(0) )
+ /*
+ * ...so, simply return the saved context handle...
+ */
+ return id;
+
+ /* If we're still here, this must be the first call, (or any
+ * preceding call failed to initialize the context); initialize
+ * it now, and if successful...
+ */
+ if( CryptAcquireContext( &id, NULL, NULL, RSA_MODE( FULL, VERIFYCONTEXT ) ) )
+ /*
+ * ...return the now-initialized context handle.
+ */
+ return id;
+
+ /* And finally, if we ever get to here, the context remains
+ * uninitialized; ensure that it remains marked as such, and
+ * return the uninitialized context handle.
+ */
+ return id = (HCRYPTPROV)(0);
+}
+
+CRYPTO_INLINE void *crypto_randomize( void *buf, size_t buflen )
+{
+ /* Helper to fill a specified buffer, of specified length,
+ * with cryptographically secure random bytes...
+ */
+ if( CryptGenRandom( crypto_provider(), buflen, buf ) )
+ /*
+ * ...returning a pointer to the buffer, when successful...
+ */
+ return buf;
+
+ /* ...or nothing, otherwise.
+ */
+ return NULL;
+}
+
+CRYPTO_INLINE unsigned char *crypto_random_filename_char( unsigned char *caret )
+{
+ /* Helper to generate a random sequence of characters, suitable for
+ * use in file names; although there are other valid possibilities, we
+ * restrict this to the set of lower case ASCII alpha-numerics, giving
+ * us 36 degrees of freedom for each character; (note that we cannot
+ * gain additional degrees of freedom by using mixed case, because
+ * the MS-Windows file system is case-insensitive).
+ */
+ const unsigned char span = 'z' - 'a' + 1 + '9' - '0' + 1;
+
+ /* We also wish to ensure that each of the possible 36 characters has
+ * an equal probability of selection; thus, of the UCHAR_MAX possible
+ * raw byte selections, we want to consider at most the largest even
+ * multiple of the 36 character span, which lies below the UCHAR_MAX
+ * limit, (which, since zero is a valid choice, is one less than the
+ * result of discounting the remainder from modulo division).
+ */
+ const unsigned char max = UCHAR_MAX - (UCHAR_MAX % span) - 1;
+
+ /* Deposit randomly selected characters at the "caret" location...
+ */
+ do { if( crypto_randomize( caret, sizeof( unsigned char ) ) == NULL )
+ /*
+ * ...bailing out, on any failure of the sequence generator...
+ */
+ return NULL;
+
+ /* ...until we get one which is within the largest possible
+ * subset which yields equal probabilty to each outcome, when
+ * reduced modulo the 36 available degrees of freedom.
+ */
+ } while( *caret > max );
+
+ /* Perform the modulo 36 reduction, and offset the result into the
+ * alpha-numeric character range...
+ */
+ *caret = '0' + (*caret % span);
+ /*
+ * ...while discounting those unsuitable characters which lie within
+ * the range, between '9' and 'a' exclusively.
+ */
+ if( *caret > '9' ) *caret += 'a' - '9' - 1;
+
+ /* Finally, return the "caret" location, indicating the successful
+ * transformation of the character in that position.
+ */
+ return caret;
+}
+
+char *__mingw_crypto_tmpname( char *template )
+{
+ /* Helper function, based on Microsoft's wincrypt API, to construct
+ * the candidate names for temporary files, both in a less predictable
+ * manner than Microsoft's _mktemp() function, and without suffering
+ * its inherent limitation of allowing no more than 26 file names
+ * per template per process thread.
+ *
+ * We begin by locating the position, within the given template,
+ * where the string of six replaceable 'XXXXXX's should begin.
+ */
+ char *tail = template + strlen( template ) - 6;
+
+ /* Provided this appears sane -- i.e. it at least doesn't place the
+ * six character "tail" before the start of the template itself...
+ */
+ if( tail >= template )
+ {
+ /* ...then, walk over each of the six bytes of the "tail", until
+ * we reach the NUL terminator...
+ */
+ while( *tail )
+ {
+ /* ...checking that each byte is initially ASCII 'X', as POSIX
+ * requires them to be; (note that we don't consider that these
+ * may be MBCS trail bytes, since the required 'X' is a single
+ * byte in an MBCS representation anyway)...
+ */
+ if( (*tail != 'X') || (crypto_random_filename_char( tail++ ) == NULL) )
+ /*
+ * ...bailing out, and returning nothing, if not.
+ */
+ return NULL;
+ }
+ }
+ /* Finally, when we have successfully replaced all six 'XXXXXX's,
+ * we return the modified template, in place.
+ */
+ return template;
+}
+
+/* $RCSfile$: end of file */
diff --git a/mingwrt/mingwex/mkdtemp.c b/mingwrt/mingwex/mkdtemp.c
new file mode 100644
index 0000000..c91f935
--- /dev/null
+++ b/mingwrt/mingwex/mkdtemp.c
@@ -0,0 +1,114 @@
+/*
+ * mkdtemp.c
+ *
+ * Implementation of an (approximately) POSIX conforming mkdtemp(3).
+ *
+ * $Id$
+ *
+ * Written by Keith Marshall <kei...@us...>
+ * Copyright (C) 2013, 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 OT...
[truncated message content] |