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
(1) |
7
|
8
|
9
|
10
|
11
(1) |
12
(2) |
13
(1) |
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
From: Keith M. <no...@so...> - 2016-04-13 21:01:12
|
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 40713b7cbd4d766a71a78c6b3cdd79a6491cdf96 (commit) from 3c94eba695c5ce6233295a22c70e01426004f48e (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/40713b7cbd4d766a71a78c6b3cdd79a6491cdf96/ commit 40713b7cbd4d766a71a78c6b3cdd79a6491cdf96 Author: Keith Marshall <kei...@us...> Date: Wed Apr 13 21:39:45 2016 +0100 Generalize procedure for installing manpages. --HG-- rename : mingwrt/man/dirname.man => mingwrt/man/dirname.3.man diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index eed2c0b..e8ff75b 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,21 @@ +2016-04-13 Keith Marshall <kei...@us...> + + Generalize procedure for installing manpages. + + * man/dirname.man: Rename it as... + * man/dirname.3.man: ...this, with inherent MANSECT specification. + (TH): Use %PAGEREF% substitution for NAME, MANSECT, and DATE. + (MS-Windows): Do not append \[tm]; it doesn't render well in Windows + console. Further, correct typos; some syntactic adjustments. + + * Makefile.in (%:%.man): New rule; define it. + (%.mancopy, %.mancopy-recursive): New rules; define and use with... + (reference_manpage): ...this new macro, defining it to map... + (dirname.3.man): ...this as the reference source file for both of... + (basename.3, dirname.3): ...these installed manpages. + (format_manpage): Add MANSECT and DATE to expansion of... + (%PAGEREF%): ...this sed substitution pattern. + 2016-04-12 Keith Marshall <kei...@us...> Update several incorrectly attributed header files. diff --git a/mingwrt/Makefile.in b/mingwrt/Makefile.in index b754086..9957a56 100644 --- a/mingwrt/Makefile.in +++ b/mingwrt/Makefile.in @@ -733,21 +733,31 @@ install-%-dll-files: # Install manpages. # -install-man install-manpages: install-mingwrt-manpages -format_manpage = sed "s/%PAGEREF%/`echo $1 | tr a-z A-Z` $2/" - vpath %.man ${mingwrt_srcdir}/man -basename.$(man3ext) dirname.$(man3ext): %.$(man3ext): dirname.man - $(call format_manpage,$*,$(man3ext)) $< > $@ - -mingwrt-man$(man3ext): basename.$(man3ext) dirname.$(man3ext) - +install-man install-manpages: install-mingwrt-manpages +mingwrt-man$(man3ext): $(addsuffix .$(man3ext),basename dirname) install-mingwrt-manpages: mandir mingwrt-man3 + mingwrt-man%: $(call mkinstalldirs,,${man$*dir}) $(call INSTALL_DATA,$^,${man$*dir}) $(RM) $^ +%: %.man + $(call format_manpage,$(basename $*),$(suffix $*),$<) $< > $@ + +format_manpage = sed \ + -e "s/%PAGEREF%/`echo $1 | tr a-z A-Z` $(2:.%=%) `date -r $3 +%d-%b-%Y`/" + +basename.$(man3ext): export reference_manpage = dirname.$(man3ext).man +basename.$(man3ext): %: %.mancopy-recursive + +%.mancopy-recursive: + $(MAKE) --no-print-directory $*.mancopy + +%.mancopy: $(reference_manpage) + $(call format_manpage,$(basename $*),$(suffix $*),$<) $< > $* + # Undo Installation # ----------------- diff --git a/mingwrt/man/dirname.man b/mingwrt/man/dirname.3.man similarity index 82% rename from mingwrt/man/dirname.man rename to mingwrt/man/dirname.3.man index 82e1a9a..99926e5 100644 --- a/mingwrt/man/dirname.man +++ b/mingwrt/man/dirname.3.man @@ -1,9 +1,10 @@ -.\" t -.TH DIRNAME 3 04-Jan-2007 MinGW "Programmer's Reference Manual" +'\" t +.\" vim: ft=nroff +.TH %PAGEREF% MinGW "Programmer's Reference Manual" . .SH NAME . -.BR dirname ,\0 basename +.BR \%dirname ,\0 \%basename \- parse path name components . . @@ -24,9 +25,9 @@ .SH DESCRIPTION . The -.B dirname +.BR \%dirname () and -.B basename +.BR \%basename () functions parse a null\-terminated path name string, and split it into its .B directory name @@ -37,7 +38,7 @@ Splitting is performed on the basis of the location of the .B directory separator characters, which, -for this MS\-Windows(\(tm) implementation, +for this MS\-Windows implementation, are the characters .RB \(dq / \(dq and @@ -52,7 +53,7 @@ is a colon .RB (\(dq : \(dq), the first two characters of .I path -are interpreted as an MS\-Windows(\(tm) drive designator, +are interpreted as an MS\-Windows drive designator, which will be included in the .B directory name component of @@ -63,48 +64,48 @@ component. . .PP In normal usage, -.B dirname +.BR \%dirname () returns a pointer to a string representing the path name component of .IR path , up to but not including the rightmost directory separator, while -.B basename +.BR \%basename () returns a pointer to the component following this separator. Any trailing directory separators present in .I path are disregarded, when determining the rightmost separator, and, in the case of the return value from -.BR dirname , +.BR \%dirname (), any internal sequences of recurring separator characters are each reduced to a single such character. . .PP If .I path -contains no MS\-Windows(\(tm) drive designator, +contains no MS\-Windows drive designator, and no directory separator character, then -.B dirname +.BR \%dirname () returns the string .RB \(dq . \(dq, and -.B basename +.BR \%basename () returns a copy of .IR path. If .I path -does commence with an MS\-Windows(\(tm) drive designator, +does commence with an MS\-Windows drive designator, but contains no directory separators, then -.B dirname +.BR \%dirname () returns the string .RB \(dq d:. \(dq, where .RB \(dq d: \(dq represents the drive designator, while -.B basename +.BR \%basename () returns a copy of .IR path , with its initial two characters, @@ -117,9 +118,9 @@ If is a NULL pointer, or is a pointer to an empty string, then both -.B dirname +.BR \%dirname () and -.B basename +.BR \%basename () return the string .RB \(dq . \(dq. . @@ -131,9 +132,9 @@ is the string or the string .RB \(dq \e \(dq, both -.B dirname +.BR \%dirname () and -.B basename +.BR \%basename () return the string .RB \(dq / \(dq, or the string @@ -148,15 +149,15 @@ commences with two directory separator characters, which must be similar, then -.B dirname +.BR \%dirname () will preserve these two characters in the returned path name. This construct does not affect the string returned by -.BR basename , +.BR \%basename (), neither is this behaviour replicated by -.BR dirname , +.BR \%dirname (), if .I path -includes an MS\-Windows(\(tm) drive designator. +includes an MS\-Windows drive designator. . .PP In the special case, @@ -165,13 +166,13 @@ where is specified as .I exactly two identical directory separator characters, -with no MS\-Windows(\(tm) drive designator, +with no MS\-Windows drive designator, and no following path name, -.B dirname +.BR \%dirname () returns .I path unchanged; -.B basename +.BR \%basename () normalises the return string to only a single character, either .RB \(dq / \(dq @@ -182,27 +183,27 @@ matching the characters used to specify . .PP Concatenating the string returned by -.BR dirname , +.BR \%dirname (), a .RB \(dq / \(dq or a .RB \(dq \e \(dq, and the string returned by -.B basename +.BR \%basename () yields a complete path name. . .PP The -.B dirname +.BR \%dirname () and -.B basename +.BR \%basename () functions conform generally to SUSv3, extended to accommodate the handling of .RB \(dq / \(dq and .RB \(dq \e \(dq as alternative directory separator characters, -and also to accommodate the likelihood of MS\-Windows(\(tm) +and also to accommodate the likelihood of MS\-Windows drive designators appearing in any path name specification. The example, which follows, @@ -213,9 +214,9 @@ and also the effects of the extended behaviour. .SH EXAMPLE . To verify the behaviour of the -.B dirname +.BR \%dirname () and -.B basename +.BR \%basename () functions, the test program defines the following function:\(em . @@ -241,16 +242,16 @@ void result( char *path ) .RE .PP This illustrates the correct use of the -.B dirname +.BR \%dirname () and the -.B basename +.BR \%basename () functions, with copies of the original .I path string being passed in the function calls. Note that the return values from each function are used immediately, in the -.B printf +.BR printf () call, and the temporary copies of .I path @@ -260,9 +261,9 @@ before these go out of scope. . .PP Calling this example function illustrates the effect of each of the -.B dirname +.BR \%dirname () and -.B basename +.BR \%basename () functions, for various values of .IR path . @@ -290,7 +291,7 @@ lw(15n) lw(10n) lw(10n). . .PP Similarly, -for the case where path names are expressed using the MS\-Windows(\(tm) +for the case where path names are expressed using the MS\-Windows .RB \(dq \e \(dq directory separator notation, calling the example function displays:\(em @@ -315,7 +316,7 @@ lw(15n) lw(10n) lw(10n). . .PP and, -when an MS\-Windows(\(tm) drive designator is also specified, +when an MS\-Windows drive designator is also specified, this becomes:\(em .RS .TS @@ -344,7 +345,7 @@ the special handling of path names which begin with two directory separator characters, and also that this special handling is suppressed when these two characters are dissimilar, -or when an MS\-Windows(\(tm) drive designator is specified:\(em +or when an MS\-Windows drive designator is specified:\(em .RS .TS tab(!); @@ -369,7 +370,7 @@ lw(15n) lw(10n) lw(10n). .SH RETURN VALUE . The -.B dirname +.BR \%dirname () function returns a pointer to a null terminated string, which represents the directory path component of the passed .I path @@ -380,7 +381,7 @@ normalised to a single separator at each level of directory nesting. . .PP The -.B basename +.BR \%basename () function returns a pointer to a null terminated string, which represents the rightmost element of the passed @@ -389,14 +390,14 @@ string, with all trailing directory separator characters removed. . .PP -If any MS\-Windows(\(tm) drive designator is specified in the input +If any MS\-Windows drive designator is specified in the input .I path string, it is included in the return value of the -.B dirname +.BR \%dirname () function, but not in that of the -.B basename +.BR \%basename () function. . . @@ -408,9 +409,9 @@ None. .SH CAVEATS AND BUGS . The -.B dirname +.BR \%dirname () and -.B basename +.BR \%basename () functions may modify the .I path string passed to them. @@ -425,9 +426,9 @@ Also note that, since the .I path argument may be modified by the -.B dirname +.BR \%dirname () or the -.B basename +.BR \%basename () function call, if you wish to preserve the original content of .IR path , @@ -437,14 +438,14 @@ either function may return its result in a statically allocated buffer, which may be overwritten on a subsequent function call. .PP Although the -.B dirname +.BR \%dirname () and -.B basename +.BR \%basename () functions parse path name strings, they are basically just .I string functions. -The presence of an MS\-Windows(\(tm) drive designator is determined +The presence of an MS\-Windows drive designator is determined by the appearance of a colon .RB (\(dq : \(dq) as the second character of the @@ -459,13 +460,13 @@ represents a valid path name. . .SH AUTHOR . -This manpage was written for the MinGW implementation of the -.B dirname +This manpage was written by \%Keith\ Marshall, +\%<kei...@us...>, to document the +.BR \%basename () and -.B basename -functions by Keith\ Marshall, -<kei...@us...>. -It may copied, modified and redistributed, +.BR \%dirname () +functions as they have been implemented for the MinGW.org Project. +It may be copied, modified and redistributed, without restriction of copyright, provided this acknowledgement of contribution by the original author remains unchanged. ----------------------------------------------------------------------- Summary of changes: mingwrt/ChangeLog | 18 ++++ mingwrt/Makefile.in | 26 ++++-- mingwrt/man/{dirname.man => dirname.3.man} | 121 ++++++++++++++-------------- 3 files changed, 97 insertions(+), 68 deletions(-) rename mingwrt/man/{dirname.man => dirname.3.man} (82%) hooks/post-receive -- Repository: mingw-org-wsl |
From: Keith M. <no...@so...> - 2016-04-12 21:20:26
|
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 3c94eba695c5ce6233295a22c70e01426004f48e (commit) from e7cdc14fa4a378e9b27f1d89abcfa0d3e9e43f08 (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/3c94eba695c5ce6233295a22c70e01426004f48e/ commit 3c94eba695c5ce6233295a22c70e01426004f48e Author: Keith Marshall <kei...@us...> Date: Tue Apr 12 15:36:20 2016 +0100 Update several incorrectly attributed header files. diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 8b996f6..eed2c0b 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,16 @@ +2016-04-12 Keith Marshall <kei...@us...> + + Update several incorrectly attributed header files. + + * include/direct.h include/io.h include/locale.h include/math.h + * include/process.h include/stdio.h include/stdlib.h include/string.h + * include/sys/stat.h include/sys/types.h include/time.h: Identify the + original author as Colin Peters; Rob Savoye merely imported them into + the original CVS repository, when he created it. + + * include/wchar.h: Likewise, imported by Rob Savoye, but the original + source file is unattributed. + 2016-04-11 Keith Marshall <kei...@us...> Eliminate all references to non-standard __NO_ISOCEXT macro. diff --git a/mingwrt/include/direct.h b/mingwrt/include/direct.h index 3954033..b533da2 100644 --- a/mingwrt/include/direct.h +++ b/mingwrt/include/direct.h @@ -6,7 +6,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997, 1999-2001, 2003, 2004, 2007, 2016, MinGW.org Project. * * diff --git a/mingwrt/include/io.h b/mingwrt/include/io.h index a93fb6e..7ab6499 100644 --- a/mingwrt/include/io.h +++ b/mingwrt/include/io.h @@ -5,7 +5,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997-2004, 2007, 2009, 2010, 2014-2016, MinGW.org Project. * * diff --git a/mingwrt/include/locale.h b/mingwrt/include/locale.h index b756a19..454aefc 100644 --- a/mingwrt/include/locale.h +++ b/mingwrt/include/locale.h @@ -6,7 +6,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997, 1999-2001, 2003, 2004, 2007, 2016, MinGW.org Project. * * diff --git a/mingwrt/include/math.h b/mingwrt/include/math.h index d5f2ab9..af94513 100644 --- a/mingwrt/include/math.h +++ b/mingwrt/include/math.h @@ -6,7 +6,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997-2009, 2014-2016, MinGW.org Project. * * diff --git a/mingwrt/include/process.h b/mingwrt/include/process.h index 93dd9cd..cda2e41 100644 --- a/mingwrt/include/process.h +++ b/mingwrt/include/process.h @@ -5,7 +5,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997-2001, 2003-2004, 2007-2008, 2016, MinGW.org Project. * * diff --git a/mingwrt/include/stdio.h b/mingwrt/include/stdio.h index 71306b7..eca9448 100644 --- a/mingwrt/include/stdio.h +++ b/mingwrt/include/stdio.h @@ -6,7 +6,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997-2005, 2007-2010, 2014-2016, MinGW.org Project. * * diff --git a/mingwrt/include/stdlib.h b/mingwrt/include/stdlib.h index 79a7ec3..5908e63 100644 --- a/mingwrt/include/stdlib.h +++ b/mingwrt/include/stdlib.h @@ -6,7 +6,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997-2009, 2011, 2014-2016, MinGW.org Project. * * diff --git a/mingwrt/include/string.h b/mingwrt/include/string.h index e97e4d6..c10c23f 100644 --- a/mingwrt/include/string.h +++ b/mingwrt/include/string.h @@ -5,7 +5,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997-2000, 2002-2004, 2007, 2009, 2015, 2016, * MinGW.org Project. * diff --git a/mingwrt/include/sys/stat.h b/mingwrt/include/sys/stat.h index 30c18a2..94c9b7c 100644 --- a/mingwrt/include/sys/stat.h +++ b/mingwrt/include/sys/stat.h @@ -6,7 +6,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997-2001, 2003-2005, 2007, 2016, MinGW.org Project. * * diff --git a/mingwrt/include/sys/types.h b/mingwrt/include/sys/types.h index 1dbf59d..3a00343 100644 --- a/mingwrt/include/sys/types.h +++ b/mingwrt/include/sys/types.h @@ -5,7 +5,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997-1999, 2001, 2003, 2004, 2008, 2011, 2014-2016, * MinGW.org Project. * diff --git a/mingwrt/include/time.h b/mingwrt/include/time.h index aba0a13..ea90870 100644 --- a/mingwrt/include/time.h +++ b/mingwrt/include/time.h @@ -5,7 +5,7 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Written by Colin Peters <co...@bi...> * Copyright (C) 1997-2007, 2011, 2015, 2016, MinGW.org Project. * * diff --git a/mingwrt/include/wchar.h b/mingwrt/include/wchar.h index 2e19b96..da61e4e 100644 --- a/mingwrt/include/wchar.h +++ b/mingwrt/include/wchar.h @@ -6,7 +6,8 @@ * * $Id$ * - * Written by Rob Savoye <ro...@cy...> + * Unattributed original source. + * Adapted by Rob Savoye <ro...@cy...> * Copyright (C) 1997, 1999-2009, 2011, 2015, 2016, MinGW.org Project. * * ----------------------------------------------------------------------- Summary of changes: mingwrt/ChangeLog | 13 +++++++++++++ mingwrt/include/direct.h | 2 +- mingwrt/include/io.h | 2 +- mingwrt/include/locale.h | 2 +- mingwrt/include/math.h | 2 +- mingwrt/include/process.h | 2 +- mingwrt/include/stdio.h | 2 +- mingwrt/include/stdlib.h | 2 +- mingwrt/include/string.h | 2 +- mingwrt/include/sys/stat.h | 2 +- mingwrt/include/sys/types.h | 2 +- mingwrt/include/time.h | 2 +- mingwrt/include/wchar.h | 3 ++- 13 files changed, 26 insertions(+), 12 deletions(-) hooks/post-receive -- Repository: mingw-org-wsl |
From: Keith M. <no...@so...> - 2016-04-12 10:10: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 e7cdc14fa4a378e9b27f1d89abcfa0d3e9e43f08 (commit) from 96e44c0117173ee28deca192c6de2d6a2f4fcd9c (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/e7cdc14fa4a378e9b27f1d89abcfa0d3e9e43f08/ commit e7cdc14fa4a378e9b27f1d89abcfa0d3e9e43f08 Author: Keith Marshall <kei...@us...> Date: Mon Apr 11 23:25:27 2016 +0100 Eliminate all references to non-standard __NO_ISOCEXT macro. diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 6e28427..8b996f6 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,17 @@ +2016-04-11 Keith Marshall <kei...@us...> + + Eliminate all references to non-standard __NO_ISOCEXT macro. + + * include/math.h: Tidy layout. + [!defined __NO_ISOCEXT]: Do not use this ugly double negative; in any + case, we do not want to encourage users to define such implementation + private macros; instead, prefer to make use of... + [defined _ISOC99_SOURCE]: ...this glibc compatible feature test. + [__STDC_VERSION__ >= 199901L]: Do not require this; it is implied, by + definition, in _ISOC99_SOURCE. + * include/stdio.h [!defined __NO_ISOCEXT]: Likewise; replace with... + [defined _ISOC99_SOURCE]: ...this, throughout. + 2016-04-10 Keith Marshall <kei...@us...> Make resetting of __need_typedef requests more robust. diff --git a/mingwrt/include/math.h b/mingwrt/include/math.h index 7f35d71..d5f2ab9 100644 --- a/mingwrt/include/math.h +++ b/mingwrt/include/math.h @@ -7,7 +7,7 @@ * $Id$ * * Written by Rob Savoye <ro...@cy...> - * Copyright (C) 1997-2009, 2014, 2015, MinGW.org Project. + * Copyright (C) 1997-2009, 2014-2016, MinGW.org Project. * * * Permission is hereby granted, free of charge, to any person obtaining a @@ -34,39 +34,35 @@ #define _MATH_H #pragma GCC system_header -/* All the headers include this file. */ +/* All the headers include this file. + */ #include <_mingw.h> -/* - * Types for the _exception structure. +/* Types for the _exception structure. */ -#define _DOMAIN 1 /* domain error in argument */ -#define _SING 2 /* singularity */ -#define _OVERFLOW 3 /* range overflow */ -#define _UNDERFLOW 4 /* range underflow */ -#define _TLOSS 5 /* total loss of precision */ -#define _PLOSS 6 /* partial loss of precision */ - +#define _DOMAIN 1 /* domain error in argument */ +#define _SING 2 /* singularity */ +#define _OVERFLOW 3 /* range overflow */ +#define _UNDERFLOW 4 /* range underflow */ +#define _TLOSS 5 /* total loss of precision */ +#define _PLOSS 6 /* partial loss of precision */ + +#if ! defined __STRICT_ANSI__ && ! defined _NO_OLDNAMES /* * Exception types with non-ANSI names for compatibility. */ -#ifndef __STRICT_ANSI__ -#ifndef _NO_OLDNAMES - -#define DOMAIN _DOMAIN -#define SING _SING -#define OVERFLOW _OVERFLOW -#define UNDERFLOW _UNDERFLOW -#define TLOSS _TLOSS -#define PLOSS _PLOSS +#define DOMAIN _DOMAIN +#define SING _SING +#define OVERFLOW _OVERFLOW +#define UNDERFLOW _UNDERFLOW +#define TLOSS _TLOSS +#define PLOSS _PLOSS -#endif /* ! _NO_OLDNAMES */ -#endif /* ! __STRICT_ANSI__ */ +#endif /* !__STRICT_ANSI__ && !_NO_OLDNAMES */ #if _POSIX_C_SOURCE || defined _USE_MATH_DEFINES -/* - * Traditional/XOPEN math constants (double precison). MSVC makes these +/* 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). @@ -92,22 +88,23 @@ * FIXME: Since they're needed both in MinGW float.h and here, * they should be moved to a common "parts" header. */ -#ifndef __STRICT_ANSI__ -#ifndef __MINGW_FPCLASS_DEFINED -#define __MINGW_FPCLASS_DEFINED 1 -/* IEEE 754 classication */ -#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ -#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ -#define _FPCLASS_NINF 0x0004 /* Negative Infinity */ -#define _FPCLASS_NN 0x0008 /* Negative Normal */ -#define _FPCLASS_ND 0x0010 /* Negative Denormal */ -#define _FPCLASS_NZ 0x0020 /* Negative Zero */ -#define _FPCLASS_PZ 0x0040 /* Positive Zero */ -#define _FPCLASS_PD 0x0080 /* Positive Denormal */ -#define _FPCLASS_PN 0x0100 /* Positive Normal */ -#define _FPCLASS_PINF 0x0200 /* Positive Infinity */ -#endif /* __MINGW_FPCLASS_DEFINED */ -#endif /* ! __STRICT_ANSI__ */ +#if ! defined __STRICT_ANSI__ && ! defined __MINGW_FPCLASS_DEFINED +#define __MINGW_FPCLASS_DEFINED 1 + +/* IEEE 754 classication + */ +#define _FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ +#define _FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ +#define _FPCLASS_NINF 0x0004 /* Negative Infinity */ +#define _FPCLASS_NN 0x0008 /* Negative Normal */ +#define _FPCLASS_ND 0x0010 /* Negative Denormal */ +#define _FPCLASS_NZ 0x0020 /* Negative Zero */ +#define _FPCLASS_PZ 0x0040 /* Positive Zero */ +#define _FPCLASS_PD 0x0080 /* Positive Denormal */ +#define _FPCLASS_PN 0x0100 /* Positive Normal */ +#define _FPCLASS_PINF 0x0200 /* Positive Infinity */ + +#endif /* !__STRICT_ANSI__ && !__MINGW_FPCLASS_DEFINED */ #ifndef RC_INVOKED @@ -123,42 +120,41 @@ _BEGIN_C_DECLS * NOTE: The CRTDLL version uses _HUGE_dll instead. */ #if __MINGW_GNUC_PREREQ(3, 3) -#define HUGE_VAL __builtin_huge_val() -#else +#define HUGE_VAL __builtin_huge_val() +#else #ifndef __DECLSPEC_SUPPORTED #ifdef __MSVCRT__ -extern double* _imp___HUGE; -#define HUGE_VAL (*_imp___HUGE) -#else -/* CRTDLL */ -extern double* _imp___HUGE_dll; -#define HUGE_VAL (*_imp___HUGE_dll) +extern double *_imp___HUGE; +#define HUGE_VAL (*_imp___HUGE) + +#else /* CRTDLL */ +extern double *_imp___HUGE_dll; +#define HUGE_VAL (*_imp___HUGE_dll) #endif #else /* __DECLSPEC_SUPPORTED */ #ifdef __MSVCRT__ __MINGW_IMPORT double _HUGE; -#define HUGE_VAL _HUGE -#else -/* CRTDLL */ +#define HUGE_VAL _HUGE + +#else /* CRTDLL */ __MINGW_IMPORT double _HUGE_dll; -#define HUGE_VAL _HUGE_dll +#define HUGE_VAL _HUGE_dll #endif #endif /* __DECLSPEC_SUPPORTED */ #endif /* __MINGW_GNUC_PREREQ(3, 3) */ - struct _exception { - int type; - char *name; - double arg1; - double arg2; - double retval; + int type; + char *name; + double arg1; + double arg2; + double retval; }; _CRTIMP double __cdecl sin (double); @@ -184,24 +180,25 @@ _CRTIMP double __cdecl frexp (double, int*); _CRTIMP double __cdecl modf (double, double*); _CRTIMP double __cdecl fmod (double, double); -/* Excess precision when using a 64-bit mantissa for FPU math ops can - cause unexpected results with some of the MSVCRT math functions. For - example, unless the function return value is stored (truncating to - 53-bit mantissa), calls to pow with both x and y as integral values - sometimes produce a non-integral result. - One workaround is to reset the FPU env to 53-bit mantissa - by a call to fesetenv (FE_PC53_ENV). Amother is to force storage - of the return value of individual math functions using wrappers. - NB, using these wrappers will disable builtin math functions and - hence disable the folding of function results at compile time when - arguments are constant. */ - #if 0 +/* Excess precision when using a 64-bit mantissa for FPU math ops can + * cause unexpected results with some of the MSVCRT math functions. For + * example, unless the function return value is stored (truncating to + * 53-bit mantissa), calls to pow with both x and y as integral values + * sometimes produce a non-integral result. + * + * One workaround is to reset the FPU env to 53-bit mantissa + * by a call to fesetenv (FE_PC53_ENV). Amother is to force storage + * of the return value of individual math functions using wrappers. + * NB, using these wrappers will disable builtin math functions and + * hence disable the folding of function results at compile time when + * arguments are constant. + */ #define __DEFINE_FLOAT_STORE_MATHFN_D1(fn1) \ static __inline__ double \ __float_store_ ## fn1 (double x) \ { \ - __volatile__ double res = (fn1) (x); \ + __volatile__ double res = (fn1) (x); \ return res; \ } @@ -212,26 +209,26 @@ __float_store_ ## fn2 (double x, double y) \ __volatile__ double res = (fn2) (x, y); \ return res; \ } -#endif /* For example, here is how to force the result of the pow function - to be stored: */ -#if 0 + * to be stored: + */ #undef pow -/* Define the ___float_store_pow function and use it instead of pow(). */ +/* Define the ___float_store_pow function and use it instead of pow(). + */ __DEFINE_FLOAT_STORE_MATHFN_D2 (pow) #define pow __float_store_pow #endif #ifndef __STRICT_ANSI__ -/* Complex number (for _cabs). This is the MS version. The ISO - C99 counterpart _Complex is an intrinsic type in GCC and - 'complex' is defined as a macro. See complex.h */ struct _complex -{ - double x; /* Real part */ - double y; /* Imaginary part */ +{ /* Complex number (for _cabs). This is the MS version; the + * ISO-C99 counterpart, _Complex, is an intrinsic type in GCC, + * and 'complex' is defined as a macro. See <complex.h> + */ + double x; /* Real part */ + double y; /* Imaginary part */ }; _CRTIMP double __cdecl _cabs (struct _complex); @@ -245,13 +242,13 @@ _CRTIMP double __cdecl _y1 (double); _CRTIMP double __cdecl _yn (int, double); _CRTIMP int __cdecl _matherr (struct _exception *); -/* These are also declared in Mingw float.h; needed here as well to work - around GCC build issues. */ +/* These are also declared in MinGW's <float.h>; we need them + * here as well to work around GCC build issues. + */ /* BEGIN FLOAT.H COPY */ /* * IEEE recommended functions */ - _CRTIMP double __cdecl _chgsign (double); _CRTIMP double __cdecl _copysign (double, double); _CRTIMP double __cdecl _logb (double); @@ -265,13 +262,10 @@ _CRTIMP int __cdecl _isnan (double); /* END FLOAT.H COPY */ -/* - * Non-underscored versions of non-ANSI functions. +#ifndef _NO_OLDNAMES +/* Non-underscored versions of non-ANSI functions. * These reside in liboldnames.a. */ - -#if !defined (_NO_OLDNAMES) - _CRTIMP double __cdecl j0 (double); _CRTIMP double __cdecl j1 (double); _CRTIMP double __cdecl jn (int, double); @@ -302,61 +296,66 @@ _CRTIMP int __cdecl fpclass (double); #define FP_NNORM _FPCLASS_NN #define FP_PNORM _FPCLASS_PN -#endif /* ! _NO_OLDNAMES */ +#endif /* !_NO_OLDNAMES */ -/* This require msvcr70.dll or higher. */ -#if __MSVCRT_VERSION__ >= 0x0700 +#if _WIN32_WINNT >= _WIN32_WINNT_WINXP || __MSVCRT_VERSION__ >= __MSVCR70_DLL +/* + * This requires WinXP, or MSVCR70.DLL, or later. + */ _CRTIMP int __cdecl _set_SSE2_enable (int); -#endif /* __MSVCRT_VERSION__ >= 0x0700 */ +#endif /* >= WINXP || >= __MSVCR70_DLL */ +#endif /* !__STRICT_ANSI__ */ -#endif /* __STRICT_ANSI__ */ +#if defined __cplusplus || defined _ISOC99_SOURCE +# if __MINGW_GNUC_PREREQ(3, 3) +# define HUGE_VALF __builtin_huge_valf() +# define HUGE_VALL __builtin_huge_vall() +# define INFINITY __builtin_inf() +# define NAN __builtin_nan("") +# else + extern const float __INFF; + extern const long double __INFL; + extern const double __QNAN; -#ifndef __NO_ISOCEXT -#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ - || !defined __STRICT_ANSI__ || defined __cplusplus +# define HUGE_VALF __INFF +# define HUGE_VALL __INFL +# define INFINITY HUGE_VALF +# define NAN __QNAN -#if __MINGW_GNUC_PREREQ(3, 3) -#define HUGE_VALF __builtin_huge_valf() -#define HUGE_VALL __builtin_huge_vall() -#define INFINITY __builtin_inf() -#define NAN __builtin_nan("") -#else -extern const float __INFF; -#define HUGE_VALF __INFF -extern const long double __INFL; -#define HUGE_VALL __INFL -#define INFINITY HUGE_VALF -extern const double __QNAN; -#define NAN __QNAN -#endif /* __MINGW_GNUC_PREREQ(3, 3) */ +# endif /* __MINGW_GNUC_PREREQ(3, 3) */ -/* Use the compiler's builtin define for FLT_EVAL_METHOD to - set float_t and double_t. */ -#if defined(__FLT_EVAL_METHOD__) -# if ( __FLT_EVAL_METHOD__== 0) -typedef float float_t; -typedef double double_t; -# elif (__FLT_EVAL_METHOD__ == 1) -typedef double float_t; -typedef double double_t; -# elif (__FLT_EVAL_METHOD__ == 2) -typedef long double float_t; -typedef long double double_t; -#endif -#else /* ix87 FPU default */ -typedef long double float_t; -typedef long double double_t; +#ifdef __FLT_EVAL_METHOD__ +/* Use the compiler's builtin definition for FLT_EVAL_METHOD + * to establish appropriate float_t and double_t typedefs. + */ +# if __FLT_EVAL_METHOD__ == 0 + typedef float float_t; + typedef double double_t; + +# elif __FLT_EVAL_METHOD__ == 1 + typedef double float_t; + typedef double double_t; + +# elif __FLT_EVAL_METHOD__ == 2 + typedef long double float_t; + typedef long double double_t; + +# endif +#else + /* ix87 FPU default + */ + typedef long double float_t; + typedef long double double_t; #endif -/* 7.12.3.1 */ -/* - Return values for fpclassify. - These are based on Intel x87 fpu condition codes - in the high byte of status word and differ from - the return values for MS IEEE 754 extension _fpclass() -*/ +/* 7.12.3.1 + * Return values for fpclassify. + * These are based on Intel x87 fpu condition codes + * in the high byte of status word and differ from + * the return values for MS IEEE 754 extension _fpclass() + */ #define FP_NAN 0x0100 #define FP_NORMAL 0x0400 #define FP_INFINITE (FP_NAN | FP_NORMAL) @@ -364,14 +363,11 @@ typedef long double double_t; #define FP_SUBNORMAL (FP_NORMAL | FP_ZERO) /* 0x0200 is signbit mask */ - -/* - We can't inline float or double, because we want to ensure truncation - to semantic type before classification. - (A normal long double value might become subnormal when - converted to double, and zero when converted to float.) -*/ - +/* We can't inline float or double, because we want to ensure + * truncation to semantic type before classification; (a normal + * long double value might become subnormal when converted to + * double, and zero when converted to float.) + */ extern int __cdecl __fpclassifyf (float); extern int __cdecl __fpclassify (double); extern int __cdecl __fpclassifyl (long double); @@ -396,7 +392,8 @@ __CRT_INLINE int __cdecl __fpclassifyl (long double x){ /* 7.12.3.4 */ /* We don't need to worry about truncation here: - A NaN stays a NaN. */ + * a NaN stays a NaN. + */ extern int __cdecl __isnan (double); extern int __cdecl __isnanf (float); extern int __cdecl __isnanl (long double); @@ -464,7 +461,8 @@ __CRT_INLINE int __cdecl __signbitl (long double x) { : sizeof (x) == sizeof (double) ? __signbit (x) \ : __signbitl (x)) -/* 7.12.4 Trigonometric functions: Double in C89 */ +/* 7.12.4 Trigonometric functions: double in C89 + */ extern float __cdecl sinf (float); extern long double __cdecl sinl (long double); @@ -486,7 +484,8 @@ extern long double __cdecl atanl (long double); extern float __cdecl atan2f (float, float); extern long double __cdecl atan2l (long double, long double); -/* 7.12.5 Hyperbolic functions: Double in C89 */ +/* 7.12.5 Hyperbolic functions: double in C89 + */ extern float __cdecl sinhf (float); #ifndef __NO_INLINE__ __CRT_INLINE float __cdecl sinhf (float x) @@ -591,7 +590,8 @@ extern float __cdecl logbf (float); extern long double __cdecl logbl (long double); /* Inline versions. GCC-4.0+ can do a better fast-math optimization - with __builtins. */ + * with __builtins. + */ #ifndef __NO_INLINE__ #if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) __CRT_INLINE double __cdecl logb (double x) @@ -617,8 +617,8 @@ __CRT_INLINE long double __cdecl logbl (long double x) "fstp %%st" : "=t" (res) : "0" (x)); return res; } -#endif /* !defined __FAST_MATH__ || !__MINGW_GNUC_PREREQ (4, 0) */ -#endif /* !defined __NO_INLINE__ */ +#endif /* !__FAST_MATH__ || !__MINGW_GNUC_PREREQ (4, 0) */ +#endif /* !__NO_INLINE__ */ /* 7.12.6.12 Double in C89 */ extern float __cdecl modff (float, float*); @@ -709,7 +709,8 @@ extern long long __cdecl llrintf (float); extern long long __cdecl llrintl (long double); /* Inline versions of above. - GCC 4.0+ can do a better fast-math job with __builtins. */ + * GCC 4.0+ can do a better fast-math job with __builtins. + */ #ifndef __NO_INLINE__ #if !(__MINGW_GNUC_PREREQ (4, 0) && defined __FAST_MATH__ ) __CRT_INLINE double __cdecl rint (double x) @@ -780,8 +781,8 @@ __CRT_INLINE long long __cdecl llrintl (long double x) ("fistpll %0" : "=m" (retval) : "t" (x) : "st"); return retval; } -#endif /* !__FAST_MATH__ || !__MINGW_GNUC_PREREQ (4,0) */ -#endif /* !defined __NO_INLINE */ +#endif /* !__FAST_MATH__ || !__MINGW_GNUC_PREREQ (4,0) */ +#endif /* !__NO_INLINE__ */ /* 7.12.9.6 */ /* round away from zero, regardless of fpu control word settings */ @@ -873,7 +874,6 @@ extern long double __cdecl fmal (long double, long double, long double); /* 7.12.14 - * * With these functions, comparisons involving quiet NaNs set the FP * condition code to "unordered". The IEEE floating-point spec * dictates that the result of floating-point comparisons should be @@ -889,7 +889,7 @@ extern long double __cdecl fmal (long double, long double, long double); #define islessgreater(x, y) __builtin_islessgreater(x, y) #define isunordered(x, y) __builtin_isunordered(x, y) -#else /* __GNUC__ < 3 */ +#else /* __GNUC__ < 3 */ /* helper */ extern int __cdecl __fp_unordered_compare (long double, long double); #ifndef __NO_INLINE__ @@ -900,7 +900,7 @@ __fp_unordered_compare (long double x, long double y){ "fnstsw;": "=a" (retval) : "t" (x), "u" (y)); return retval; } -#endif /* ! __NO_INLINE__ */ +#endif /* !__NO_INLINE__ */ #define isgreater(x, y) ((__fp_unordered_compare(x, y) & 0x4500) == 0) #define isless(x, y) ((__fp_unordered_compare(y, x) & 0x4500) == 0) @@ -909,11 +909,10 @@ __fp_unordered_compare (long double x, long double y){ #define islessgreater(x, y) ((__fp_unordered_compare(x, y) & FP_SUBNORMAL) == 0) #define isunordered(x, y) ((__fp_unordered_compare(x, y) & 0x4500) == 0x4500) -#endif /* __GNUC__ < 3 */ -#endif /* __STDC_VERSION__ >= 199901L */ -#endif /* __NO_ISOCEXT */ +#endif /* __GNUC__ < 3 */ +#endif /* __cplusplus || _ISOC99_SOURCE */ _END_C_DECLS -#endif /* ! RC_INVOKED */ -#endif /* ! _MATH_H: $RCSfile$: end of file */ +#endif /* ! RC_INVOKED */ +#endif /* !_MATH_H: $RCSfile$: end of file */ diff --git a/mingwrt/include/stdio.h b/mingwrt/include/stdio.h index 4cdff19..71306b7 100644 --- a/mingwrt/include/stdio.h +++ b/mingwrt/include/stdio.h @@ -432,13 +432,12 @@ _CRTIMP __cdecl __MINGW_NOTHROW int _snprintf (char *, size_t, const char *, .. _CRTIMP __cdecl __MINGW_NOTHROW int _vsnprintf (char *, size_t, const char *, __VALIST); _CRTIMP __cdecl __MINGW_NOTHROW int _vscprintf (const char *, __VALIST); -#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ -/* - * Microsoft does not provide implementations for the following, - * which are required by C99. Note in particular that the corresponding - * Microsoft implementations of _snprintf() and _vsnprintf() are *not* - * compatible with C99, but the following are; if you want the MSVCRT - * behaviour, you *must* use the Microsoft uglified names. +#ifdef _ISOC99_SOURCE +/* Microsoft does not provide implementations for the following, + * which are required by C99. Note in particular that Microsoft's + * corresponding implementations of _snprintf() and _vsnprintf() are + * NOT compatible with C99, but the following are; if you want the + * MSVCRT behaviour, you MUST use the Microsoft "uglified" names. */ __cdecl __MINGW_NOTHROW int snprintf (char *, size_t, const char *, ...); __cdecl __MINGW_NOTHROW int vsnprintf (char *, size_t, const char *, __VALIST); @@ -451,7 +450,7 @@ int vfscanf (FILE * __restrict__, const char * __restrict__, __VALIST); __cdecl __MINGW_NOTHROW int vsscanf (const char * __restrict__, const char * __restrict__, __VALIST); -#endif /* !__NO_ISOCEXT */ +#endif /* _ISOC99_SOURCE */ #if __MSVCRT_VERSION__ >= __MSVCR80_DLL || _WIN32_WINNT >= _WIN32_WINNT_VISTA /* * In MSVCR80.DLL, (and its descendants), Microsoft introduced variants @@ -890,9 +889,9 @@ _CRTIMP __cdecl __MINGW_NOTHROW FILE * _wpopen (const wchar_t *, const wchar #endif /* !__STRICT_ANSI__ */ #endif /* __MSVCRT__ */ -#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ -__cdecl __MINGW_NOTHROW int snwprintf (wchar_t *, size_t, const wchar_t *, ...); -__cdecl __MINGW_NOTHROW int vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST); +#ifdef _ISOC99_SOURCE +__cdecl __MINGW_NOTHROW int snwprintf (wchar_t *, size_t, const wchar_t *, ...); +__cdecl __MINGW_NOTHROW int vsnwprintf (wchar_t *, size_t, const wchar_t *, __VALIST); #ifndef __NO_INLINE__ __CRT_INLINE __cdecl __MINGW_NOTHROW @@ -907,7 +906,7 @@ int vfwscanf (FILE *__restrict__, const wchar_t *__restrict__, __VALIST); __cdecl __MINGW_NOTHROW int vswscanf (const wchar_t *__restrict__, const wchar_t * __restrict__, __VALIST); -#endif /* !__NO__ISOCEXT */ +#endif /* _ISOC99_SOURCE */ #endif /* ! (_STDIO_H && _WCHAR_H) */ #if defined _STDIO_H && ! defined __STRICT_ANSI__ ----------------------------------------------------------------------- Summary of changes: mingwrt/ChangeLog | 14 ++ mingwrt/include/math.h | 317 +++++++++++++++++++++++------------------------ mingwrt/include/stdio.h | 23 ++-- 3 files changed, 183 insertions(+), 171 deletions(-) hooks/post-receive -- Repository: mingw-org-wsl |
From: Keith M. <no...@so...> - 2016-04-11 08:23:44
|
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 96e44c0117173ee28deca192c6de2d6a2f4fcd9c (commit) via d933ead8f44916fc4bf0dbb67b0ad5fc79ac1266 (commit) from 1081fbecf7c99afd1f39b3606ef38f311e8353f5 (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/96e44c0117173ee28deca192c6de2d6a2f4fcd9c/ commit 96e44c0117173ee28deca192c6de2d6a2f4fcd9c Author: Keith Marshall <kei...@us...> Date: Sun Apr 10 22:54:10 2016 +0100 Make resetting of __need_typedef requests more robust. diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 2ed400f..6e28427 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,5 +1,18 @@ 2016-04-10 Keith Marshall <kei...@us...> + Make resetting of __need_typedef requests more robust. + + * include/sys/types.h [__need_off_t, __need___off64_t] + [__need_ssize_t, __need_time_t]: Move corresponding #undef out of, and + after the respective conditional blocks, which provide each associated + typedef, so ensuring that any repeat request is properly reset. + + * include/time.h [__need_time_t]: Always delegate to <sys/types.h> for + typedef, and reset of request, even in cases where... + [_TIME_H]: ...this is already defined. + +2016-04-10 Keith Marshall <kei...@us...> + Add a missing comment terminator. * include/io.h [!(defined _IO_H && defined _WCHAR_H)]: Properly diff --git a/mingwrt/include/sys/types.h b/mingwrt/include/sys/types.h index 82cb4f3..1dbf59d 100644 --- a/mingwrt/include/sys/types.h +++ b/mingwrt/include/sys/types.h @@ -78,8 +78,8 @@ */ # define __have_typedef_off_t # endif -# undef __need_off_t #endif +#undef __need_off_t #if ! defined __have_typedef___off64_t \ && ( defined _SYS_TYPES_H || defined __need___off64_t ) @@ -102,8 +102,8 @@ */ # define __have_typedef___off64_t # endif -# undef __need___off64_t #endif +#undef __need___off64_t #if ! defined __have_typedef_ssize_t \ && ( defined _SYS_TYPES_H || defined __need_ssize_t ) @@ -124,8 +124,8 @@ */ # define __have_typedef_ssize_t # endif -# undef __need_ssize_t #endif +#undef __need_ssize_t #if ! defined __have_typedef_time_t \ && ( defined _SYS_TYPES_H || defined __need_time_t ) @@ -155,8 +155,8 @@ */ # define __have_typedef_time_t 1 # endif -# undef __need_time_t #endif +#undef __need_time_t #ifdef _SYS_TYPES_H /* This is normal <sys/types.h> inclusion, i.e. for its own sake. diff --git a/mingwrt/include/time.h b/mingwrt/include/time.h index edefff4..aba0a13 100644 --- a/mingwrt/include/time.h +++ b/mingwrt/include/time.h @@ -29,14 +29,26 @@ * DEALINGS IN THE SOFTWARE. * */ -#ifndef _TIME_H +#if ! defined _TIME_H || defined __need_time_t #pragma GCC system_header +/* Irrespective of whether this is normal or selective inclusion of + * <time.h>, we ALWAYS require the definition for time_t; get it by + * selective inclusion from its primary source, in <sys/types.h>; + * note that we must ALWAYS delegate this, when __need_time_t is + * defined, even when _TIME_H had been defined previously, to ensure + * that __need_time_t is properly reset, and thus cannot compromise + * a later inclusion of <sys/types.h> + */ +#undef __need_time_h +#define __need_time_t 1 +#include <sys/types.h> + +#ifndef _TIME_H /* To support selective partial inclusion, we do not immediately define * the normal _TIME_H guard macro; initially, we also clear all of those * declaraction subset selection macros which are applicable herein. */ -#undef __need_time_t #undef __need_struct_timespec #undef __need_wchar_decls @@ -74,13 +86,6 @@ struct tm; #endif #ifndef RC_INVOKED -/* Irrespective of whether this is normal or selective inclusion of - * <time.h>, we ALWAYS require the definition for time_t; get it by - * selective inclusion from its primary source, in <sys/types.h> - */ -#define __need_time_t 1 -#include <sys/types.h> - #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. @@ -488,4 +493,5 @@ _END_C_DECLS #undef __need_wchar_decls #endif /* ! RC_INVOKED */ -#endif /* ! _TIME_H: $RCSfile$: end of file */ +#endif /* !_TIME_H after __need_time_t processing */ +#endif /* !_TIME_H: $RCSfile$: end of file */ https://sf.net/p/mingw/mingw-org-wsl/ci/d933ead8f44916fc4bf0dbb67b0ad5fc79ac1266/ commit d933ead8f44916fc4bf0dbb67b0ad5fc79ac1266 Author: Keith Marshall <kei...@us...> Date: Sun Apr 10 22:20:12 2016 +0100 Add a missing comment terminator. diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 792719b..2ed400f 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,10 @@ +2016-04-10 Keith Marshall <kei...@us...> + + Add a missing comment terminator. + + * include/io.h [!(defined _IO_H && defined _WCHAR_H)]: Properly + terminate the comment annotating the closing #endif statement. + 2016-04-06 Keith Marshall <kei...@us...> Declare <dir.h> as formally deprecated. diff --git a/mingwrt/include/io.h b/mingwrt/include/io.h index 1e0efdd..a93fb6e 100644 --- a/mingwrt/include/io.h +++ b/mingwrt/include/io.h @@ -75,7 +75,7 @@ #define _A_SYSTEM 0x00000004 #define _A_VOLID 0x00000008 #define _A_SUBDIR 0x00000010 -#define _A_ARCH 0x00000020 +#define _A_ARCH 0x00000020 #ifndef RC_INVOKED @@ -99,7 +99,7 @@ * _WCHAR_H is ALSO defined). */ typedef unsigned long _fsize_t; -#endif /* ! (_IO_H && _WCHAR_H) +#endif /* ! (_IO_H && _WCHAR_H) */ /* Functions for searching for files: _findfirst() sets errno to ENOENT, * and returns -1 if no match is found; otherwise it returns a handle to ----------------------------------------------------------------------- Summary of changes: mingwrt/ChangeLog | 20 ++++++++++++++++++++ mingwrt/include/io.h | 4 ++-- mingwrt/include/sys/types.h | 8 ++++---- mingwrt/include/time.h | 26 ++++++++++++++++---------- 4 files changed, 42 insertions(+), 16 deletions(-) hooks/post-receive -- Repository: mingw-org-wsl |
From: Keith M. <no...@so...> - 2016-04-06 20:08:34
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Repository: mingw-org-wsl". The branch, legacy has been updated via 1081fbecf7c99afd1f39b3606ef38f311e8353f5 (commit) via 43ee17ed5096b15051c37cf60cf86375ca17869b (commit) via 6440ce656205bd254a6514e694aeab4cc210b5a7 (commit) via 05a0f4fa24c80793f19f2d789d1d57fb4605d253 (commit) via ae8ef7ff6a43778bbd09d2d9f38b24e119aca9ff (commit) from 9f2e6762930506d66a0d3c5ed81eac5b240b3a31 (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/1081fbecf7c99afd1f39b3606ef38f311e8353f5/ commit 1081fbecf7c99afd1f39b3606ef38f311e8353f5 Author: Keith Marshall <kei...@us...> Date: Wed Apr 6 15:27:39 2016 +0100 Declare <dir.h> as formally deprecated. diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 54c41bd..792719b 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,5 +1,14 @@ 2016-04-06 Keith Marshall <kei...@us...> + Declare <dir.h> as formally deprecated. + + * include/dir.h: Assert copyright. + (pragma GCC system_header): Declare it. + (_DIR_H): Define as multiple inclusion macro. + [!_DIR_H]: Emit "obsolete header" warning message. + +2016-04-06 Keith Marshall <kei...@us...> + Factor out <wchar.h> vs. <io.h> duplicate declarations. * include/io.h: Assert copyright; tidy layout. diff --git a/mingwrt/include/dir.h b/mingwrt/include/dir.h index 60ab89e..6897d82 100644 --- a/mingwrt/include/dir.h +++ b/mingwrt/include/dir.h @@ -1,26 +1,40 @@ /* * dir.h * - * This file OBSOLESCENT and only provided for backward compatibility. - * Please use io.h instead. + * Obsolete header replaced by <io.h>; this stub is retained for + * backward compatibility only. * - * This file is part of the Mingw32 package. + * $Id$ * - * Contributors: - * Created by Colin Peters <co...@bi...> - * Mumit Khan <kh...@xr...> + * Written by Colin Peters <co...@bi...> + * Copyright (C) 1997-1999, 2001, 2016, MinGW.org Project * - * THIS SOFTWARE IS NOT COPYRIGHTED * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. + * 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: * - * 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. + * The above copyright notice, this permission notice, and the following + * disclaimer shall be included in all copies or substantial portions of + * the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER + * DEALINGS IN THE SOFTWARE. * */ +#ifndef _DIR_H +#pragma GCC system_header +#define _DIR_H +#warning "<dir.h> is obsolete; please use <io.h> instead." #include <io.h> +#endif /* !_DIR_H: $RCSfile$: end of file */ https://sf.net/p/mingw/mingw-org-wsl/ci/43ee17ed5096b15051c37cf60cf86375ca17869b/ commit 43ee17ed5096b15051c37cf60cf86375ca17869b Author: Keith Marshall <kei...@us...> Date: Wed Apr 6 13:57:56 2016 +0100 Factor out <wchar.h> vs. <io.h> duplicate declarations. diff --git a/mingwrt/ChangeLog b/mingwrt/ChangeLog index 693b3ce..54c41bd 100644 --- a/mingwrt/ChangeLog +++ b/mingwrt/ChangeLog @@ -1,3 +1,47 @@ +2016-04-06 Keith Marshall <kei...@us...> + + Factor out <wchar.h> vs. <io.h> duplicate declarations. + + * include/io.h: Assert copyright; tidy layout. + (_IO_H_): Rename this multiple inclusion guard macro... + (_IO_H): ...to this preferred form; do not define it when... + [__WCHAR_H_SOURCED__]: ...this is defined, in which case declare... + (_waccess, _wchmod, _wcreat, _wopen, _wsopen, _wunlink, _wmktemp) + (_wfindfirst, _wfindnext, _wfindfirst64, _wfindnext64, _wfindfirsti64) + (_wfindnexti64, _wfindfirst32i64, _wfindnext32i64, _wfindfirst64i32) + (_wfindnext64i32, _wfindfirst32, _wfindnext32, _findclose): ...only + these function prototypes, common to <wchar.h>, together with... + (_fsize_t, struct _wfinddata_t, struct _wfinddatai64_t) + (struct __wfinddata64_t, struct _wfinddata64i32_t) + (struct _wfinddata32i64_t, struct __wfinddata32_t): ...these + requisite data type definitions. + (pragma GCC system_header): Declare it. + (__need_intptr_t): Define, and include <stdint.h> to get... + (intptr_t): ...this typedef; neither define it locally, nor define... + (_INTPTR_T_DEFINED): ...this; delete all references. + (_FSIZE_T_DEFINED): Do not define it; delete all references; rather... + [!(defined _IO_H && defined _WCHAR)] (_fsize_t): Define it. + (FILENAME_MAX): Define it unconditionally. + (__struct_finddata_t): New temporary macro; define and use it to... + (struct _finddata_t, struct _wfinddata_t, struct _finddatai64_t) + (struct _wfinddatai64_t, struct __finddata64_t, struct __wfinddata64_t) + (struct _finddata64i32_t, struct _wfinddata64i32_t) + (struct _finddata32i64_t, struct _wfinddata32i64_t) + (struct __finddata32_t, struct __wfinddata32_t): ...define these. + + * include/wchar.h (_WFINDDATA_T_DEFINED): Do not define it; delete all + references; filter out associated data type definitions, namely... + (struct _wfinddata_t, struct _wfinddatai64_t): ...these, and also... + (struct __wfinddata64_t, struct _wfinddata64i32_t): ...these, and... + (struct _wfinddata32i64_t, struct __wfinddata32_t): ...these. + (_WIO_DEFINED): Likewise, do not define it; delete all references; + filter out associated function prototype declarations for all of... + (_waccess, _wchmod, _wcreat, _wopen, _wsopen, _wunlink, _wmktemp) + (_wfindfirst, _wfindnext, _wfindfirst64, _wfindnext64, _wfindfirsti64) + (_wfindnexti64, _wfindfirst32i64, _wfindnext32i64, _wfindfirst64i32) + (_wfindnext64i32, _wfindfirst32, _wfindnext32): ...these; reproduce + them by selective inclusion of <io.h>. + 2016-04-04 Keith Marshall <kei...@us...> Factor out <wchar.h> vs. <process.h> duplicate declarations. diff --git a/mingwrt/include/io.h b/mingwrt/include/io.h index f059f7e..1e0efdd 100644 --- a/mingwrt/include/io.h +++ b/mingwrt/include/io.h @@ -1,305 +1,482 @@ /* * io.h - * This file has no copyright assigned and is placed in the Public Domain. - * This file is a part of the mingw-runtime package. - * No warranty is given; refer to the file DISCLAIMER within the package. * * System level I/O functions and types. * - * TODO: File requires review; rationalization and refactoring recommended. + * $Id$ + * + * Written by Rob Savoye <ro...@cy...> + * Copyright (C) 1997-2004, 2007, 2009, 2010, 2014-2016, 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. + * + * + * NOTE: The file manipulation functions provided by Microsoft seem to + * work with either slash (/) or backslash (\) as the directory separator; + * (this is consistent with Microsoft's own documentation, on MSDN). + * */ -#ifndef _IO_H_ -#define _IO_H_ +#ifndef _IO_H +#pragma GCC system_header -/* All the headers include this file. */ +/* Defer definition of the _IO_H multiple inclusion guard, to allow + * for selective inclusion by <wchar.h>, (in which case we should + * NOT define it). + */ +#ifndef __WCHAR_H_SOURCED__ +#define _IO_H + +/* All MinGW headers must include <_mingw.h>; we may do it here, + * assuming that <wchar.h> will have already take care to do so in + * the selective inclusion case. + */ #include <_mingw.h> -/* MSVC's io.h contains the stuff from dir.h, so I will too. - * NOTE: This also defines off_t, the file offset type, through - * an inclusion of sys/types.h */ +/* We also need time_t, and off_t, (and their variants); although + * it gives us more than we really need, this will provide them... + */ +#include <sys/types.h> -#include <sys/types.h> /* To get time_t. */ +#endif /* !__WCHAR_H_SOURCED__ */ -/* - * Attributes of files as returned by _findfirst et al. +/* This will give us intptr_t, which we need in ALL cases, whether + * including <io.h> directly, or selectively via <wchar.h>. */ -#define _A_NORMAL 0x00000000 -#define _A_RDONLY 0x00000001 -#define _A_HIDDEN 0x00000002 -#define _A_SYSTEM 0x00000004 -#define _A_VOLID 0x00000008 -#define _A_SUBDIR 0x00000010 -#define _A_ARCH 0x00000020 - +#define __need_intptr_t +#include <stdint.h> + +/* Attributes of files as returned by _findfirst() et al. MSDN is not + * explicit about whether or not these should be defined when including + * <wchar.h>, but since they complement the _wfindfirst() API, which is + * declared there, it seems logical to make them visible in all cases + * of <io.h> inclusion. + */ +#define _A_NORMAL 0x00000000 +#define _A_RDONLY 0x00000001 +#define _A_HIDDEN 0x00000002 +#define _A_SYSTEM 0x00000004 +#define _A_VOLID 0x00000008 +#define _A_SUBDIR 0x00000010 +#define _A_ARCH 0x00000020 #ifndef RC_INVOKED -#ifndef _INTPTR_T_DEFINED -#define _INTPTR_T_DEFINED -#ifdef _WIN64 - typedef __int64 intptr_t; -#else - typedef int intptr_t; -#endif -#endif +/* The maximum length of a file name. It may be better to use the Windows' + * GetVolumeInformation() function in preference to this constant, but hey, + * this works! In any case, we use this manifest constant when we declare + * the _findfirst() API, so its definition must be visible in all places + * where this, or any of its variants, is declared. + * + * Note that <stdio.h> also defines this, but we don't guard it, so that + * the compiler has a chance to catch inconsistencies. + */ +#define FILENAME_MAX (260) -#ifndef _FSIZE_T_DEFINED +/* We must define _fsize_t, but some compilers (including GCC prior to + * version 4.0), may choke if we try to do so more than once... + */ +#if ! (defined _IO_H && defined _WCHAR_H) + /* ...so DO NOT define it during direct <io.h> inclusion, (i.e. _IO_H + * is defined), if <wchar.h> has already caused it to be defined, (i.e. + * _WCHAR_H is ALSO defined). + */ typedef unsigned long _fsize_t; -#define _FSIZE_T_DEFINED -#endif +#endif /* ! (_IO_H && _WCHAR_H) + +/* Functions for searching for files: _findfirst() sets errno to ENOENT, + * and returns -1 if no match is found; otherwise it returns a handle to + * be used in _findnext() and _findclose() calls. _findnext() may then be + * used to identify further matches; it updates the search data, returning + * zero, each time a further match is found, ultimately setting errno to + * ENOENT, and returning -1 when no further match can be found. When all + * expected matches have been identified, _findclose() should be called, + * to release the resources allocated to the search data. + * + * The API comprises several variants of the _findfirst() and _findnext() + * functions, conforming generally to the usage model: + * + * intptr_t handle = _findfirst (filespec, &search_data ); + * if (handle >= (intptr_t)(0)) do { process search_data; + * } while (_findnext (handle, &search_data)); + * + * where "filespec" represents a char *, or a wchar_t * specification, + * (which may include wild cards), for a file name pattern to be matched, + * and "search_data" represents a variant of the structure: + */ +#define __struct_finddata_t(__fd_time_t, __fd_size_t) \ +{ unsigned attrib; /* Attributes, see constants above. */ \ + __fd_time_t time_create; \ + __fd_time_t time_access; /* always midnight local time */ \ + __fd_time_t time_write; \ + __fd_size_t size; \ + __fd_name_t name[FILENAME_MAX]; /* may include spaces. */ \ +} + +/* Time type and file size variations for __struct_finddata_t apply, for the + * various functions comprising the file name search API, as tabulated below: + * + * Note: this is a reproduction of reference data as published in the MSDN + * online documentation for the file name search API; it applies, specifically, + * to the implementation of this API in the non-free run-time library versions + * from MSVCR80.DLL onwards, (i.e. when __MSVCRT_VERSION__ is defined, and is + * assigned a value >= 0x800). When linking to the freely available MSVCRT.DLL + * runtime, (__MSVCRT_VERSION__ should not be defined), or any earlier version + * of the non-free run-time, the _USE_32BIT_TIME_T feature test is irrelevant; + * the information presented in this table should be interpreted as if this + * feature is always implicitly enabled. + * + * Functions _USE_32BIT_TIME_T defined? __fd_time_t __fd_size_t + * + * _findfirst(), Not defined 64-bit 32-bit + * _wfindfirst() + * _findfirst(), Defined 32-bit 32-bit + * _wfindfirst() + * + * _findfirst32(), Not affected by the macro 32-bit 32-bit + * _wfindfirst32() definition + * + * _findfirst64(), Not affected by the macro 64-bit 64-bit + * _wfindfirst64() definition + * + * _findfirsti64(), Not defined 64-bit 64-bit + * _wfindfirsti64() + * _findfirsti64(), Defined 32-bit 64-bit + * _wfindfirsti64() + * + * _findfirst32i64(), Not affected by the macro 32-bit 64-bit + * _wfindfirst32i64() definition + * + * _findfirst64i32(), Not affected by the macro 64-bit 32-bit + * _wfindfirst64i32() definition + * + */ +_BEGIN_C_DECLS -/* - * The maximum length of a file name. You should use GetVolumeInformation - * instead of this constant. But hey, this works. - * Also defined in stdio.h. +#ifdef _IO_H +#define __fd_name_t char + +/* The most universally available variants of the file name search + * API employ either a generic representation of the related data, or + * a variant in which the time stamps are represented generically, but + * the file size is explicitly expressed as a 64-bit value. */ -#ifndef FILENAME_MAX -#define FILENAME_MAX (260) -#endif +struct _finddata_t __struct_finddata_t (time_t, _fsize_t); +struct _finddatai64_t __struct_finddata_t (time_t, __int64); + +/* Functions to manipulate data in either of these representations are + * provided, as physical entities, in ALL versions of MSVCRT.DLL, and + * in the non-free variants predating MSVCR80.DLL; (each such physical + * function implementation interprets "generic" as 32-bit for both the + * time_t and _fsize_t data fields). From MSVCR80.DLL onward, there is + * no physical implementation of these functions; they are emulated by + * inline replacements (implemented below), which introduce ambiguity + * in the interpretation of "generic", (noted as applicable): thus... + */ +#if __MSVCRT_VERSION__ < __MSVCR80_DLL +/* ...these physical function APIs are declared only when it is NOT + * specified that MSVCR80.DLL or later is to be used. + */ +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _findfirst (const char *, struct _finddata_t *); -/* - * The following structure is filled in by _findfirst or _findnext when - * they succeed in finding a match. - */ -struct _finddata_t -{ - unsigned attrib; /* Attributes, see constants above. */ - time_t time_create; - time_t time_access; /* always midnight local time */ - time_t time_write; - _fsize_t size; - char name[FILENAME_MAX]; /* may include spaces. */ -}; - -struct _finddatai64_t { - unsigned attrib; - time_t time_create; - time_t time_access; - time_t time_write; - __int64 size; - char name[FILENAME_MAX]; -}; - -#if __MSVCRT_VERSION__ >= 0x0601 -struct __finddata64_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; -/* 8 bytes are returned so it can't be _fsize_t */ - __int64 size; - char name[FILENAME_MAX]; -}; -#endif +_CRTIMP __cdecl __MINGW_NOTHROW +int _findnext (intptr_t, struct _finddata_t *); -#if __MSVCRT_VERSION__ >= 0x0800 -struct _finddata32_t { - unsigned attrib; - __time32_t time_create; - __time32_t time_access; - __time32_t time_write; - __int32 size; - char name[FILENAME_MAX]; -}; - -struct _finddata32i64_t { - unsigned attrib; - __time32_t time_create; - __time32_t time_access; - __time32_t time_write; - __int64 size; - char name[FILENAME_MAX]; -}; - -struct _finddata64i32_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; - __int32 size; - char name[FILENAME_MAX]; -}; -#endif /* __MSVCRT_VERSION__ >= 0x0800 */ - - -#ifndef _WFINDDATA_T_DEFINED -struct _wfinddata_t { - unsigned attrib; - time_t time_create; /* -1 for FAT file systems */ - time_t time_access; /* -1 for FAT file systems */ - time_t time_write; - _fsize_t size; - wchar_t name[FILENAME_MAX]; /* may include spaces. */ -}; - -struct _wfinddatai64_t { - unsigned attrib; - time_t time_create; - time_t time_access; - time_t time_write; - __int64 size; - wchar_t name[FILENAME_MAX]; -}; - -#if __MSVCRT_VERSION__ >= 0x0601 -struct __wfinddata64_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; -/* 8 bytes are returned so it can't be _fsize_t */ - __int64 size; - wchar_t name[FILENAME_MAX]; -}; -#endif +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _findfirsti64 (const char *, struct _finddatai64_t *); -#if __MSVCRT_VERSION__ >= 0x0800 -struct __wfinddata32_t { - unsigned attrib; - __time32_t time_create; - __time32_t time_access; - __time32_t time_write; - __int32 size; - wchar_t name[FILENAME_MAX]; -}; - -struct _wfinddata32i64_t { - unsigned attrib; - __time32_t time_create; - __time32_t time_access; - __time32_t time_write; - __int64 size; - wchar_t name[FILENAME_MAX]; -}; - -struct _wfinddata64i32_t { - unsigned attrib; - __time64_t time_create; - __time64_t time_access; - __time64_t time_write; - __int32 size; - wchar_t name[FILENAME_MAX]; -}; -#endif /* __MSVCRT_VERSION__ >= 0x0800 */ - - -#define _WFINDDATA_T_DEFINED -#endif +_CRTIMP __cdecl __MINGW_NOTHROW +int _findnexti64 (intptr_t, struct _finddatai64_t *); -_BEGIN_C_DECLS +#endif /* __MSVCRT_VERSION__ < __MSVCR80_DLL */ -/* - * Functions for searching for files. _findfirst returns -1 if no match - * is found. Otherwise it returns a handle to be used in _findnext and - * _findclose calls. _findnext also returns -1 if no match could be found, - * and 0 if a match was found. Call _findclose when you are finished. +#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K || __MSVCRT_VERSION__ >= __MSVCR61_DLL +/* The Win2K release of MSVCRT.DLL added a third variant of the API, + * which had originally been introduced in MSVCR61.DLL; this variant + * uses a data representation having both 64-bit time stamp values, + * and 64-bit file size values. (Note that there was no explictly + * all 32-bit variant added at this point in the evolution of the + * API; had there been, it would have been identically equivalent + * to the original generic _findfirst()/_findnext() implementation). */ -/* FIXME: Should these all use intptr_t, as per recent MSDN docs? */ -#if __MSVCRT_VERSION__ >= 0x0800 -/* -intptr_t _findfirst (const char *filespec,struct _finddata_t *fileinfo); -intptr_t _findfirst32 (const char *filespec,struct _finddata32_t *fileinfo); -intptr_t _findfirst64 (const char *filespec,struct __finddata64_t *fileinfo); -intptr_t _findfirsti64 (const char *filespec,struct _finddatai64_t *fileinfo); -intptr_t _findfirst32i64 (const char *filespec,struct _finddata32i64_t *fileinfo); -intptr_t _findfirst64i32 (const char *filespec,struct _finddata64i32_t *fileinfo); - -intptr_t _wfindfirst (const wchar_t *filespec,struct _wfinddata_t *fileinfo); -intptr_t _wfindfirst32 (const wchar_t *filespec,struct __wfinddata32_t *fileinfo); -intptr_t _wfindfirst64 (const wchar_t *filespec, struct __wfinddata64_t *fileinfo); -intptr_t _wfindfirsti64 (const wchar_t *filespec, struct _wfinddatai64_t *fileinfo); -intptr_t _wfindfirst32i64(const wchar_t *filespec, struct _wfinddata32i64_t *fileinfo); -intptr_t _wfindfirst64i32(const wchar_t *filespec, struct _wfinddata64i32_t *fileinfo); - -Time Type and File Length Type Variations of _findfirst: -Functions _USE_32BIT_TIME_T defined? Time type File length type -_findfirst, Not defined 64-bit 32-bit -_wfindfirst -_findfirst, Defined 32-bit 32-bit -_wfindfirst - -_findfirst32, Not affected by the macro 32-bit 32-bit -_wfindfirst32 definition - -_findfirst64, Not affected by the macro 64-bit 64-bit -_wfindfirst64 definition - -_findfirsti64, Not defined 64-bit 64-bit -_wfindfirsti64 -_findfirsti64, Defined 32-bit 64-bit -_wfindfirsti64 - -_findfirst32i64, Not affected by the macro 32-bit 64-bit -_wfindfirst32i64 definition - -_findfirst64i32, Not affected by the macro 64-bit 32-bit -_wfindfirst64i32 definition -*/ -#endif -#if __MSVCRT_VERSION__ < 0x0800 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirst (const char*, struct _finddata_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findnext (intptr_t, struct _finddata_t*); -#endif /* __MSVCRT_VERSION__ < 0x0800 */ -_CRTIMP int __cdecl __MINGW_NOTHROW _findclose (intptr_t); -#if __MSVCRT_VERSION__ >= 0x0800 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirst32 (const char*, struct _finddata32_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findnext32 (intptr_t, struct _finddata32_t*); -#endif /* __MSVCRT_VERSION__ >= 0x0800 */ - -_CRTIMP int __cdecl __MINGW_NOTHROW _chdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _getcwd (char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _mkdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW _mktemp (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _rmdir (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _chmod (const char*, int); +struct __finddata64_t __struct_finddata_t (__time64_t, __int64); + +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _findfirst64 (const char *, struct __finddata64_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _findnext64 (intptr_t, struct __finddata64_t *); + +#if __MSVCRT_VERSION__ >= __MSVCR80_DLL +/* MSVCR80.DLL introduced three new data structures, with explicitly + * sized elements; in the order specified below, the first and second + * of these three are identically equivalent to the representations of + * struct _finddata_t, and struct _finddatai64_t, as they are required + * to be implemented to match the implementations of the corresponding + * functions in ALL versions of MSVCRT.DLL, whereas the third has no + * counterpart, in ANY version of MSVCRT.DLL. + */ +struct _finddata32_t __struct_finddata_t (__time32_t, __int32); +struct _finddata32i64_t __struct_finddata_t (__time32_t, __int64); +struct _finddata64i32_t __struct_finddata_t (__time64_t, __int32); + +/* The actual functions implemented in MSVCR80.DLL, and its derivatives, + * corresponding to each of these three data structures are: + */ +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _findfirst32 (const char *, struct _finddata32_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _findnext32 (intptr_t, struct _finddata32_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _findfirst32i64 (const char *, struct _finddata32i64_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _findnext32i64 (intptr_t, struct _finddata32i64_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _findfirst64i32 (const char *, struct _finddata64i32_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _findnext64i32 (intptr_t, struct _finddata64i32_t *); + +/* Since MSVCR80.DLL, and its later derivatives, provide no physical + * implementations of the original file name search API functions, we + * must emulate them, (as Microsoft do), by providing replacements in + * the form of inline functions; in doing so, we also need to contend + * with the insane ambiguity of Microsoft's _USE_32BIT_TIME_T feature + * test; thus... + */ +#if defined _USE_32BIT_TIME_T +/* ...when the user has defined the _USE_32BIT_TIME_T macro, we provide + * inline implementations which remain fully compatible with the actual + * functions, as provided by MSVCRT.DLL; (note that we do not provide + * __JMPSTUB__ or __LIBIMPL__ references here, since we have no basis + * for a rational choice between ambiguous alternatives). + */ +__CRT_ALIAS __cdecl __MINGW_NOTHROW +intptr_t _findfirst (const char *__filespec, struct _finddata_t *__search) +{ return _findfirst32 (__filespec, (struct _finddata32_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +int _findnext (intptr_t __handle, struct _finddata_t *__search) +{ return _findnext32 (__handle, (struct _finddata32_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +intptr_t _findfirsti64 (const char *__filespec, struct _finddatai64_t *__search) +{ return _findfirst32i64 (__filespec, (struct _finddata32i64_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +int _findnexti64 (intptr_t __handle, struct _finddatai64_t *__search) +{ return _findnext32i64 (__handle, (struct _finddata32i64_t *)(__search)); } + +#else /* !_USE_32BIT_TIME_T */ +/* ...but, when the user has NOT defined _USE_32BIT_TIME_T, we emulate + * the brain damaged default behaviour of Microsoft's own SDKs. This + * accommodates an extended range of valid time stamp values, but it + * utterly destroys compatibility with MSVCRT.DLL! + */ +__CRT_ALIAS __cdecl __MINGW_NOTHROW +intptr_t _findfirst (const char *__filespec, struct _finddata_t *__search) +{ return _findfirst64i32 (__filespec, (struct _finddata64i32_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +int _findnext (intptr_t __handle, struct _finddata_t *__search) +{ return _findnext64i32 (__handle, (struct _finddata64i32_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +intptr_t _findfirsti64 (const char *__filespec, struct _finddatai64_t *__search) +{ return _findfirst64 (__filespec, (struct __finddata64_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +int _findnexti64 (intptr_t __handle, struct _finddatai64_t *__search) +{ return _findnext64 (__handle, (struct __finddata64_t *)(__search)); } + +#endif /* !_USE_32BIT_TIME_T */ +#endif /* __MSVCRT_VERSION__ >= __MSVCR80_DLL */ +#endif /* >= WIN2K || >= MSVCR61.DLL */ + +#undef __fd_name_t +#endif /* _IO_H */ + +#if ! (defined _IO_H && defined _WCHAR_H) +/* Wide character file name analogue of the file name search API; + * declared both here, in <io.h>, and via selective inclusion from + * <wchar.h>, it mirrors all aspects of the preceding API declarations, + * except that all file names are expressed as wchar_t. + */ +#define __fd_name_t wchar_t + +/* Thus, the original API comprised this pair of generically specified + * data structures... + */ +struct _wfinddata_t __struct_finddata_t (time_t, _fsize_t); +struct _wfinddatai64_t __struct_finddata_t (time_t, __int64); + +#if __MSVCRT_VERSION__ < __MSVCR80_DLL +/* ...with corresponding functions to manipulate them; once again, there + * is no physical implementation of these in MSVCR80.DLL or later, so we + * declare them only when it is NOT specified that one of these run-time + * library versions is to be used. + */ +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _wfindfirst (const wchar_t *, struct _wfinddata_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _wfindnext (intptr_t, struct _wfinddata_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _wfindfirsti64 (const wchar_t *, struct _wfinddatai64_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _wfindnexti64 (intptr_t, struct _wfinddatai64_t *); + +#endif /* __MSVCRT_VERSION__ < __MSVCR80_DLL */ + +#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K || __MSVCRT_VERSION__ >= __MSVCR61_DLL +/* Win2K also added an all-64-bit variant of the _wfinddata API to + * MSVCRT.DLL, after it originally appeared in MSVCR61.DLL. + */ +struct __wfinddata64_t __struct_finddata_t (__time64_t, __int64); + +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _wfindfirst64 (const wchar_t *, struct __wfinddata64_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _wfindnext64 (intptr_t, struct __wfinddata64_t *); + +#if __MSVCRT_VERSION__ >= __MSVCR80_DLL +/* MSVCR80.DLL introduced a further three variants, which remain + * exclusive to it and its later derivatives; none of these are + * available in any version of MSVCRT.DLL. + */ +struct __wfinddata32_t __struct_finddata_t (__time32_t, __int32); +struct _wfinddata32i64_t __struct_finddata_t (__time32_t, __int64); +struct _wfinddata64i32_t __struct_finddata_t (__time64_t, __int32); + +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _wfindfirst32 (const wchar_t *, struct __wfinddata32_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _wfindnext32 (intptr_t, struct __wfinddata32_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _wfindfirst32i64 (const wchar_t *, struct _wfinddata32i64_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +intptr_t _wfindfirst64i32 (const wchar_t *, struct _wfinddata64i32_t *); + +_CRTIMP __cdecl __MINGW_NOTHROW +int _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t *); + +/* Once again, the variants of this API with generic time_t data + * fields are NOT supported by any physical function implementation + * in MSVCR80.DLL and later, so must be emulated; (again, we do not + * provide any __JMPSTUB__ or __LIBIMPL__ references). + */ +#ifdef _USE_32BIT_TIME_T +/* First, we provide inline implementations which retain compatibility + * with the physical implementations in MSVCRT.DLL; they require the + * user to define the _USE_32BIT_TIME_T feature test macro... + */ +__CRT_ALIAS __cdecl __MINGW_NOTHROW +intptr_t _wfindfirst (const wchar_t *__filespec, struct _wfinddata_t *__search) +{ return _wfindfirst32 (__filespec, (struct __wfinddata32_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +int _wfindnext (intptr_t __handle, struct _wfinddata_t *__search) +{ return _wfindnext32 (__handle, (struct __wfinddata32_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +intptr_t _wfindfirsti64 (const wchar_t *__filespec, struct _wfinddatai64_t *__search) +{ return _wfindfirst32i64 (__filespec, (struct _wfinddata32i64_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +int _wfindnexti64 (intptr_t __handle, struct _wfinddatai64_t *__search) +{ return _wfindnext32i64 (__handle, (struct _wfinddata32i64_t *)(__search)); } + +#else /* !_USE_32BIT_TIME_T */ +/* ...whereas the brain damaged Microsoft defaults, which apply when + * _USE_32BIT_TIME_T is not defined, break MSVCRT.DLL compatibility. + */ +__CRT_ALIAS __cdecl __MINGW_NOTHROW +intptr_t _wfindfirst (const wchar_t *__filespec, struct _wfinddata_t *__search) +{ return _wfindfirst64i32 (__filespec, (struct _wfinddata64i32_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +int _wfindnext (intptr_t __handle, struct _wfinddata_t *__search) +{ return _wfindnext64i32 (__handle, (struct _wfinddata64i32_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +intptr_t _wfindfirsti64 (const wchar_t *__filespec, struct _wfinddatai64_t *__search) +{ return _wfindfirst64 (__filespec, (struct __wfinddata64_t *)(__search)); } + +__CRT_ALIAS __cdecl __MINGW_NOTHROW +int _wfindnexti64 (intptr_t __handle, struct _wfinddatai64_t *__search) +{ return _wfindnext64 (__handle, (struct __wfinddata64_t *)(__search)); } + +#endif /* !_USE_32BIT_TIME_T */ +#endif /* __MSVCRT_VERSION__ >= MSVCR80.DLL */ +#endif /* >= _WIN2K || >= MSVCR61.DLL */ + +#undef __fd_name_t +#endif /* ! (_IO_H && _WCHAR_H) */ + +/* We have no further use for the __struct_finddata_t macro; delete it! + */ +#undef __struct_finddata_t + +/* MSDN documents that <io.h> must be included to get a prototype for + * _findclose(), which kind of negates the usefulness of declaring the + * wchar_t variants of the file name search API in <wchar.h>; mitigate + * this anomaly, by declaring _findclose() such that either <io.h> or + * <wchar.h> will provide it. + */ +_CRTIMP __cdecl __MINGW_NOTHROW int _findclose (intptr_t); + +#ifdef _IO_H +/* The following declarations are to be exposed only when <io.h> is + * included directly. + */ +_CRTIMP __cdecl __MINGW_NOTHROW int _chdir (const char *); +_CRTIMP __cdecl __MINGW_NOTHROW char *_getcwd (char *, int); +_CRTIMP __cdecl __MINGW_NOTHROW int _mkdir (const char *); +_CRTIMP __cdecl __MINGW_NOTHROW char *_mktemp (char *); +_CRTIMP __cdecl __MINGW_NOTHROW int _rmdir (const char *); +_CRTIMP __cdecl __MINGW_NOTHROW int _chmod (const char *, int); + #ifdef __MSVCRT__ -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _filelengthi64(int); -#if __MSVCRT_VERSION__ < 0x0800 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirsti64(const char*, struct _finddatai64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findnexti64(intptr_t, struct _finddatai64_t*); -#else -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirst32i64 (const char*, struct _finddata32i64_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirst64i32 (const char*, struct _finddata64i32_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findnext32i64 (intptr_t, struct _finddata32i64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findnext64i32 (intptr_t, struct _finddata64i32_t*); -#endif /* __MSVCRT_VERSION__ < 0x0800 */ -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _lseeki64(int, __int64, int); -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _telli64(int); -/* These require newer versions of msvcrt.dll (6.1 or higher). */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _findfirst64(const char*, struct __finddata64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _findnext64(intptr_t, struct __finddata64_t*); -#endif /* __MSVCRT_VERSION__ >= 0x0601 */ -#if __MSVCRT_VERSION__ >= 0x0800 -#ifndef _USE_32BIT_TIME_T -/* 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 -__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 */ +_CRTIMP __cdecl __MINGW_NOTHROW __int64 _filelengthi64 (int); +_CRTIMP __cdecl __MINGW_NOTHROW __int64 _lseeki64 (int, __int64, int); +_CRTIMP __cdecl __MINGW_NOTHROW __int64 _telli64 (int); #ifndef __NO_MINGW_LFS __CRT_INLINE __off64_t lseek64 (int, __off64_t, int); __CRT_INLINE __JMPSTUB__(( FUNCTION = lseek64, REMAPPED = _lseeki64 )) __off64_t lseek64 (int fd, __off64_t offset, int whence) -{ return _lseeki64(fd, (__int64)(offset), whence); } +{ return _lseeki64 (fd, (__int64)(offset), whence); } #endif #endif /* __MSVCRT__ */ @@ -307,186 +484,179 @@ __off64_t lseek64 (int fd, __off64_t offset, int whence) #ifndef _NO_OLDNAMES #ifndef _UWIN -_CRTIMP int __cdecl __MINGW_NOTHROW chdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW getcwd (char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW mkdir (const char*); -_CRTIMP char* __cdecl __MINGW_NOTHROW mktemp (char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rmdir (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW chmod (const char*, int); +_CRTIMP __cdecl __MINGW_NOTHROW int chdir (const char *); +_CRTIMP __cdecl __MINGW_NOTHROW char *getcwd (char *, int); +_CRTIMP __cdecl __MINGW_NOTHROW int mkdir (const char *); +_CRTIMP __cdecl __MINGW_NOTHROW char *mktemp (char *); +_CRTIMP __cdecl __MINGW_NOTHROW int rmdir (const char *); +_CRTIMP __cdecl __MINGW_NOTHROW int chmod (const char *, int); #endif /* _UWIN */ -#endif /* Not _NO_OLDNAMES */ +#endif /* !_NO_OLDNAMES */ +#endif /* _IO_H */ _END_C_DECLS -#endif /* Not RC_INVOKED */ +#endif /* ! RC_INVOKED */ -/* TODO: Maximum number of open handles has not been tested, I just set - * it the same as FOPEN_MAX. */ -#define HANDLE_MAX FOPEN_MAX +#ifdef _IO_H +/* Still applicable only when <io.h> is included directly, but we also + * allow the resource compiler to see these. + * + * TODO: Maximum number of open handles has not been tested; we just set + * it the same as FOPEN_MAX. + */ +#define HANDLE_MAX FOPEN_MAX -/* Some defines for _access nAccessMode (MS doesn't define them, but - * it doesn't seem to hurt to add them). */ -#define F_OK 0 /* Check for file existence */ -/* Well maybe it does hurt. On newer versions of MSVCRT, an access mode - of 1 causes invalid parameter error. */ -#define X_OK 1 /* MS access() doesn't check for execute permission. */ -#define W_OK 2 /* Check for write permission */ -#define R_OK 4 /* Check for read permission */ +/* Some defines for _access() mode checking: (Microsoft doesn't define + * them, but it doesn't seem to hurt to add them ... or perhaps it does + * hurt; on newer versions of MSVCRT.DLL, an access mode of 1 may raise + * an invalid parameter error! + */ +#define F_OK 0 /* Check for file existence */ +#define X_OK 1 /* MS access() doesn't check for execute permission. */ +#define W_OK 2 /* Check for write permission */ +#define R_OK 4 /* Check for read permission */ +#endif /* _IO_H */ #ifndef RC_INVOKED _BEGIN_C_DECLS -_CRTIMP int __cdecl __MINGW_NOTHROW _access (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _chsize (int, long); -_CRTIMP int __cdecl __MINGW_NOTHROW _close (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _commit(int); +#ifdef _IO_H +/* Again, specific to <io.h>, but not applicable to resources. + */ +_CRTIMP __cdecl __MINGW_NOTHROW int _access (const char *, int); +_CRTIMP __cdecl __MINGW_NOTHROW int _chsize (int, long); +_CRTIMP __cdecl __MINGW_NOTHROW int _close (int); +_CRTIMP __cdecl __MINGW_NOTHROW int _commit (int); -/* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80), - * the "owner write permission" bit (on FAT). */ -_CRTIMP int __cdecl __MINGW_NOTHROW _creat (const char*, int); +/* NOTE: The only significant permissions bit appears to be + * bit 7 (0x80), the "owner write permission" bit (on FAT). + */ +_CRTIMP __cdecl __MINGW_NOTHROW int _creat (const char *, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _dup (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _dup2 (int, int); -_CRTIMP long __cdecl __MINGW_NOTHROW _filelength (int); -_CRTIMP long __cdecl __MINGW_NOTHROW _get_osfhandle (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _isatty (int); +_CRTIMP __cdecl __MINGW_NOTHROW int _dup (int); +_CRTIMP __cdecl __MINGW_NOTHROW int _dup2 (int, int); +_CRTIMP __cdecl __MINGW_NOTHROW long _filelength (int); +_CRTIMP __cdecl __MINGW_NOTHROW long _get_osfhandle (int); +_CRTIMP __cdecl __MINGW_NOTHROW int _isatty (int); +#ifndef _STREAM_COMPAT /* In a very odd turn of events this function is excluded from those * files which define _STREAM_COMPAT. This is required in order to * build GNU libio because of a conflict with _eof in streambuf.h * line 107. Actually I might just be able to change the name of - * the enum member in streambuf.h... we'll see. TODO */ -#ifndef _STREAM_COMPAT -_CRTIMP int __cdecl __MINGW_NOTHROW _eof (int); + * the enum member in streambuf.h ... we'll see. TODO + */ +_CRTIMP __cdecl __MINGW_NOTHROW int _eof (int); #endif -/* LK_... locking commands defined in sys/locking.h. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _locking (int, int, long); - -_CRTIMP long __cdecl __MINGW_NOTHROW _lseek (int, long, int); - -/* Optional third argument is unsigned unPermissions. */ -_CRTIMP int __cdecl __MINGW_NOTHROW _open (const char*, int, ...); - -_CRTIMP int __cdecl __MINGW_NOTHROW _open_osfhandle (intptr_t, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _pipe (int *, unsigned int, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _read (int, void*, unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW _setmode (int, int); -/* MS puts remove & rename (but not wide versions) in io.h as well - as in stdio.h. */ -_CRTIMP int __cdecl __MINGW_NOTHROW remove (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW rename (const char*, const char*); - -/* SH_... flags for nShFlags defined in share.h - * Optional fourth argument is unsigned unPermissions */ -_CRTIMP int __cdecl __MINGW_NOTHROW _sopen (const char*, int, int, ...); - -_CRTIMP long __cdecl __MINGW_NOTHROW _tell (int); -/* Should umask be in sys/stat.h and/or sys/types.h instead? */ -_CRTIMP int __cdecl __MINGW_NOTHROW _umask (int); -_CRTIMP int __cdecl __MINGW_NOTHROW _unlink (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW _write (int, const void*, unsigned int); - -/* Wide character versions. Also declared in wchar.h. */ -/* Not in crtdll.dll */ -#if !defined (_WIO_DEFINED) -#if defined (__MSVCRT__) -_CRTIMP int __cdecl __MINGW_NOTHROW _waccess(const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wchmod(const wchar_t*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW _wcreat(const wchar_t*, int); -#if __MSVCRT_VERSION__ < 0x0800 -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst(const wchar_t*, struct _wfinddata_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext(long, struct _wfinddata_t *); -#else -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst32 (const wchar_t*, struct __wfinddata32_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext32 (long, struct __wfinddata32_t*); -#endif /* __MSVCRT_VERSION__ < 0x0800 */ -_CRTIMP int __cdecl __MINGW_NOTHROW _wunlink(const wchar_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wopen(const wchar_t*, int, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW _wsopen(const wchar_t*, int, int, ...); -_CRTIMP wchar_t * __cdecl __MINGW_NOTHROW _wmktemp(wchar_t*); -#if __MSVCRT_VERSION__ < 0x0800 -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnexti64(long, struct _wfinddatai64_t*); -#else -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst32i64 (const wchar_t*, struct _wfinddata32i64_t*); -_CRTIMP long __cdecl __MINGW_NOTHROW _wfindfirst64i32 (const wchar_t*, struct _wfinddata64i32_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext32i64 (long, struct _wfinddata32i64_t*); -_CRTIMP int __cdecl __MINGW_NOTHROW _wfindnext64i32 (long, struct _wfinddata64i32_t*); -#endif /* __MSVCRT_VERSION__ < 0x0800 */ -#if __MSVCRT_VERSION__ >= 0x0601 -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindfirst64(const wchar_t*, struct __wfinddata64_t*); -_CRTIMP intptr_t __cdecl __MINGW_NOTHROW _wfindnext64(intptr_t, struct __wfinddata64_t*); -#endif -#if __MSVCRT_VERSION__ >= 0x0800 -#ifndef _USE_32BIT_TIME_T -/* 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 -__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__) */ -#define _WIO_DEFINED -#endif /* _WIO_DEFINED */ - -#ifndef _NO_OLDNAMES -/* - * Non-underscored versions of non-ANSI functions to improve portability. - * These functions live in libmoldname.a. +/* Locking files: attribute constants are defined in <sys/locking.h>, + * which users are expected to include. + */ +_CRTIMP __cdecl __MINGW_NOTHROW int _locking (int, int, long); + +_CRTIMP __cdecl __MINGW_NOTHROW long _lseek (int, long, int); + +/* Opening files, (or streams); manifest constants for construction of + * the mode flags are defined in <fctl.h>, which users are expected to + * include. The "optional" third argument is an unsigned int; it is + * REQUIRED, when creating a new file, to specify the permissions to + * apply when said file is released by the creating process. + */ +_CRTIMP __cdecl __MINGW_NOTHROW int _open (const char *, int, ...); + +_CRTIMP __cdecl __MINGW_NOTHROW int _open_osfhandle (intptr_t, int); +_CRTIMP __cdecl __MINGW_NOTHROW int _pipe (int *, unsigned int, int); +_CRTIMP __cdecl __MINGW_NOTHROW int _read (int, void *, unsigned int); +_CRTIMP __cdecl __MINGW_NOTHROW int _setmode (int, int); + +/* Microsoft declares remove() & rename(), (but not their wchar_t + * counterparts), in <io.h> as well as in <stdio.h>; these should be + * consistent with <stdio.h>, but we trust the compiler to alert us + * (eventually) if not. + */ +_CRTIMP __cdecl __MINGW_NOTHROW int remove (const char *); +_CRTIMP __cdecl __MINGW_NOTHROW int rename (const char *, const char *); + +/* Open files with specified sharing attributes; manifest constants + * for constructing the sharing mode argument are in <share.h>, which + * users must include. The optional fourth argument is an unsigned + * int, specifing permissions to apply after closing a new file. */ +_CRTIMP __cdecl __MINGW_NOTHROW int _sopen (const char *, int, int, ...); + +_CRTIMP __cdecl __MINGW_NOTHROW long _tell (int); +/* FIXME: POSIX wants umask() in <sys/stat.h>, and, although vague, + * Microsoft may agree; we declare it here as well! + */ +_CRTIMP __cdecl __MINGW_NOTHROW int _umask (int); +_CRTIMP __cdecl __MINGW_NOTHROW int _unlink (const char *); +_CRTIMP __cdecl __MINGW_NOTHROW int _write (int, const void *, unsigned int); +#endif /* _IO_H */ + +#if defined __MSVCRT__ && ! (defined _IO_H && defined _WCHAR_H) +/* These wchar_t functions are made available for selective inclusion + * by <wchar.h>, in addition to direct inclusion of <io.h>, but they + * are only supported by MSVCRT.DLL and derivatives; they don't exist + * in CRTDLL.DLL. Furthermore, if both _IO_H and _WCHAR_H have been + * defined, by the time we get here, then this must be direct <io.h> + * inclusion, and we've already declared these by prior inclusion of + * <wchar.h>; there is no need to declare them again. + */ +_CRTIMP __cdecl __MINGW_NOTHROW int _waccess (const wchar_t *, int); +_CRTIMP __cdecl __MINGW_NOTHROW int _wchmod (const wchar_t *, int); +_CRTIMP __cdecl __MINGW_NOTHROW int _wcreat (const wchar_t *, int); +_CRTIMP __cdecl __MINGW_NOTHROW int _wunlink (const wchar_t *); +_CRTIMP __cdecl __MINGW_NOTHROW int _wopen (const wchar_t *, int, ...); +_CRTIMP __cdecl __MINGW_NOTHROW int _wsopen (const wchar_t *, int, int, ...); +_CRTIMP __cdecl __MINGW_NOTHROW wchar_t *_wmktemp (wchar_t *); +#endif /* __MSVCRT__ && ! (_IO_H && _WCHAR_H) */ + +#if defined _IO_H && ! defined _NO_OLDNAMES +/* Non-underscored versions of non-ANSI functions to improve portability; + * these are implemented in libmoldname.a, and once again are declared + * only when <io.h> is included directly. + */ #ifndef _UWIN -_CRTIMP int __cdecl __MINGW_NOTHROW access (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW chsize (int, long ); -_CRTIMP int __cdecl __MINGW_NOTHROW close (int); -_CRTIMP int __cdecl __MINGW_NOTHROW creat (const char*, int); -_CRTIMP int __cdecl __MINGW_NOTHROW dup (int); -_CRTIMP int __cdecl __MINGW_NOTHROW dup2 (int, int); -_CRTIMP int __cdecl __MINGW_NOTHROW eof (int); -_CRTIMP long __cdecl __MINGW_NOTHROW filelength (int); -_CRTIMP int __cdecl __MINGW_NOTHROW isatty (int); -_CRTIMP long __cdecl __MINGW_NOTHROW lseek (int, long, int); -_CRTIMP int __cdecl __MINGW_NOTHROW open (const char*, int, ...); -_CRTIMP int __cdecl __MINGW_NOTHROW read (int, void*, unsigned int); -_CRTIMP int __cdecl __MINGW_NOTHROW setmode (int, int); -_CRTIMP int __cdecl __MINGW_NOTHROW sopen (const char*, int, int, ...); -_CRTIMP long __cdecl __MINGW_NOTHROW tell (int); -_CRTIMP int __cdecl __MINGW_NOTHROW umask (int); -_CRTIMP int __cdecl __MINGW_NOTHROW unlink (const char*); -_CRTIMP int __cdecl __MINGW_NOTHROW write (int, const void*, unsigned int); -#endif /* _UWIN */ +_CRTIMP __cdecl __MINGW_NOTHROW int access (const char*, int); +_CRTIMP __cdecl __MINGW_NOTHROW int chsize (int, long ); +_CRTIMP __cdecl __MINGW_NOTHROW int close (int); +_CRTIMP __cdecl __MINGW_NOTHROW int creat (const char*, int); +_CRTIMP __cdecl __MINGW_NOTHROW int dup (int); +_CRTIMP __cdecl __MINGW_NOTHROW int dup2 (int, int); +_CRTIMP __cdecl __MINGW_NOTHROW int eof (int); +_CRTIMP __cdecl __MINGW_NOTHROW long filelength (int); +_CRTIMP __cdecl __MINGW_NOTHROW int isatty (int); +_CRTIMP __cdecl __MINGW_NOTHROW long lseek (int, long, int); +_CRTIMP __cdecl __MINGW_NOTHROW int open (const char*, int, ...); +_CRTIMP __cdecl __MINGW_NOTHROW int read (int, void*, unsigned int); +_CRTIMP __cdecl __MINGW_NOTHROW int setmode (int, int); +_CRTIMP __cdecl __MINGW_NOTHROW int sopen (const char*, int, int, ...); +_CRTIMP __cdecl __MINGW_NOTHROW long tell (int); +_CRTIMP __cdecl __MINGW_NOTHROW int umask (int); +_CRTIMP __cdecl __MINGW_NOTHROW int unlink (const char*); +_CRTIMP __cdecl __MINGW_NOTHROW int write (int, const void*, unsigned int); +#endif /* !_UWIN */ #ifdef __USE_MINGW_ACCESS -/* Old versions of MSVCRT access() just ignored X_OK, while the version - shipped with Vista, returns an error code. This will restore the - old behaviour */ -static inline int __mingw_access (const char* __fname, int __mode) +/* Old versions of MSVCRT.DLL's access() just ignored X_OK, while the + * version shipped with Vista fails; this inline implementation of the + * portably named access() function protects against such failure. + */ +#define access(__fname,__mode) __mingw_access (__fname, __mode) +static __inline__ int __mingw_access (const char* __fname, int __mode) { return _access (__fname, __mode & ~X_OK); } -#define access(__f,__m) __mingw_access (__f, __m) -#endif +#endif /* _USE_MINGW_ACCESS */ -/* Wide character versions. Also declared in wchar.h. */ -/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */ #if 0 +/* FIXME: + * Wide character versions: may also be declared in <wchar.h>. + * Where do these live? Not in libmoldname.a nor in libmsvcrt.a; + * do they exist at all? + */ int waccess(const wchar_t *, int); int wchmod(const wchar_t *, int); int wcreat(const wchar_t *, int); @@ -499,10 +669,9 @@ int wsopen(const wchar_t *, int, int, ...); wchar_t * wmktemp(wchar_t *); #endif -#endif /* Not _NO_OLDNAMES */ +#endif /* !_NO_OLDNAMES */ _END_C_DECLS -#endif /* Not RC_INVOKED */ - -#endif /* _IO_H_ not defined */ +#endif /* ! RC_INVOKED */ +#endif /* !_IO_H: $RCSfile$: end of file */ diff --git a/mingwrt/include/wchar.h b/mingwrt/include/wchar.h index 8be0812..2e19b96 100644 --- a/mingwrt/include/wchar.h +++ b/mingwrt/include/wchar.h @@ -213,6 +213,58 @@ * int _wstat64i32 (const wchar_t *, struct _stat64i32 *); * * + * while from... + */ +#include <io.h> +/* ...we obtain function prototypes for each of the following, which + * are available in all versions of MSVCRT.DLL, (and all its non-free + * derivatives), but are not supported by CRTDLL.DLL: + * + * int _waccess (const wchar_t *, int); + * int _wchmod (const wchar_t *, int); + * int _wcreat (const wchar_t *, int); + * int _wopen (const wchar_t *, int, ...); + * int _wsopen (const wchar_t *, int, int, ...); + * int _wunlink (const wchar_t *); + * wchar_t *_wmktemp (wchar_t *); + * + * ...and also function prototypes and definitions of all associated + * data types and manifest constants for the following, each of which + * is physically implemented in all versions of MSVCRT.DLL, and in each + * of its non-free variants prior to MSVCR80.DLL, or emulated by inline + * replacement functions for MSVCR80.DLL and later: + * + * intptr_t _wfindfirst (wchar_t *, struct _wfinddata_t *); + * int _wfindnext (intptr_t, struct _wfinddata_t *); + * + * intptr_t _wfindfirsti64 (wchar_t *, struct _wfinddatai64_t *); + * int _wfindnexti64 (intptr_t, struct _wfinddatai64_t *); + * + * ...this additional pair of functions, available in all versions of + * MSVCRT.DLL from Win2K, and non-free variants from MSVCR61.DLL: + * + * intptr_t _wfindfirst64 (wchar_t *, struct __wfinddata64_t *); + * int _wfindnext64 (intptr_t, struct __wfinddata64_t *); + * + * ...and these, which are only available in the non-free run-times + * from MSVCR80.DLL onwards: + * + * intptr_t _wfindfirst32 (wchar_t *, struct __wfinddata32_t *); + * int _wfindnext32 (intptr_t, struct __wfinddata32_t *); + * + * intptr_t _wfindfirst32i64 (wchar_t *, struct _wfinddata32i64_t *); + * int _wfindnext32i64 (intptr_t, struct _wfinddata32i64_t *); + * + * intptr_t _wfindfirst64i32 (wchar_t *, struct _wfinddata64i32_t *); + * int _wfindnext64i32 (intptr_t, struct _wfinddata64i32_t *); + * + * Additionally, although Microsoft's <wchar.h> may not declare it, + * this is required to complement all variants of the _wfindfirst() + * and _wfindnext() API, so we also declare the prototype for: + * + * int _findclose (intptr_t); + * + * * and from... */ #include <time.h> @@ -395,172 +447,71 @@ _CRTIMP __cdecl __MINGW_NOTHROW wchar_t *wcsupr (wchar_t *); #endif /* !(RC_INVOKED || (_WCHAR_H && _STRING_H)) */ #if defined _WCHAR_H && ! defined RC_INVOKED -/* These are resolved by -lmingwex. Alternatively, they can be resolved by - adding -lmsvcp60 to your command line, which will give you the VC++ - versions of these functions. If you want the latter and don't have - msvcp60.dll in your windows system directory, you can easily obtain - it with a search from your favorite search engine. */ #ifndef __STRICT_ANSI__ -typedef wchar_t _Wint_t; +typedef wchar_t _Wint_t; #endif typedef int mbstate_t; -wint_t __cdecl __MINGW_NOTHROW btowc(int); -size_t __cdecl __MINGW_NOTHROW mbrlen(const char * __restrict__, size_t, - mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW mbrtowc(wchar_t * __restrict__, const char * __restrict__, - size_t, mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW mbsrtowcs(wchar_t * __restrict__, const char ** __restrict__, - size_t, mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW wcrtomb(char * __restrict__, wchar_t, - mbstate_t * __restrict__); -size_t __cdecl __MINGW_NOTHROW wcsrtombs(char * __restrict__, const wchar_t ** __restrict__, - size_t, mbstate_t * __restrict__); -int __cdecl __MINGW_NOTHROW wctob(wint_t); - -#ifndef __NO_ISOCEXT /* these need static lib libmingwex.a */ -int __cdecl __MINGW_NOTHROW fwide(FILE*, int); -int __cdecl __MINGW_NOTHROW mbsinit(const mbstate_t*); +/* The following multi-byte character conversion functions are + * implemented in libmingwex.a, (and maybe also in some non-free + * Microsoft libraries, such as MSVCP60.DLL and later). + */ +__cdecl __MINGW_NOTHROW wint_t btowc (int); +__cdecl __MINGW_NOTHROW int wctob (wint_t); + +__cdecl __MINGW_NOTHROW +size_t mbrlen (const char *__restrict__, size_t, mbstate_t *__restrict__); + +__cdecl __MINGW_NOTHROW size_t mbrtowc +(wchar_t *__restrict__, const char *__restrict__, size_t, mbstate_t *__restrict__); + +__cdecl __MINGW_NOTHROW size_t mbsrtowcs +(wchar_t *__restrict__, const char **__restrict__, size_t, mbstate_t *__restrict__); + +__cdecl __MINGW_NOTHROW +size_t wcrtomb (char * __restrict__, wchar_t, mbstate_t *__restrict__); + +__cdecl __MINGW_NOTHROW size_t wcsrtombs +(char *__restrict__, const wchar_t **__restrict__, size_t, mbstate_t *__restrict__); + +#ifdef _ISOC99_SOURCE +/* These ISO-C99 functions are implemented in libmingwex.a, + * or, in some cases, by inline stubs. + */ +__cdecl __MINGW_NOTHROW int fwide (FILE *, int); +__cdecl __MINGW_NOTHROW int mbsinit (const mbstate_t *); + #ifndef __NO_INLINE__ -__CRT_INLINE int __cdecl __MINGW_NOTHROW fwide(FILE* __UNUSED_PARAM(stream), - int mode) - {return mode;} /* Nothing to do */ -__CRT_INLINE int __cdecl __MINGW_NOTHROW mbsinit(const mbstate_t* __UNUSED_PARAM(ps)) - {return 1;} +__CRT_INLINE __cdecl __MINGW_NOTHROW +int fwide (FILE *__UNUSED_PARAM(stream), int mode) + { return mode; } /* Nothing to do */ + +__CRT_INLINE __cdecl __MINGW_NOTHROW +int mbsinit (const mbstate_t *__UNUSED_PARAM(ps)) + { return 1; } #endif -wchar_t* __cdecl __MINGW_NOTHROW wmemset(wchar_t *, wchar_t, size_t); -wchar_t* __cdecl __MINGW_NOTHROW wmemchr(const wchar_t*, wchar_t, size_t); -int wmemcmp(const wchar_t*, const wchar_t *, size_t); -wchar_t* __cdecl __MINGW_NOTHROW wmemcpy(wchar_t* __restrict__, - const wchar_t* __restrict__, - size_t); -wchar_t* __cdecl __MINGW_NOTHROW wmemmove(wchar_t* s1, const wchar_t *, size_t); -long long __cdecl __MINGW_NOTHROW wcstoll(const wchar_t * __restrict__, - wchar_t** __restrict__, int); -unsigned long long __cdecl __MINGW_NOTHROW wcstoull(const wchar_t * __restrict__, - wchar_t ** __restrict__, int); -#endif /* __NO_ISOCEXT */ ... [truncated message content] |