The MinGW.org Windows System Libraries
Revisão | 8f3e997526003e41ff5e38447785c4d4ebd66664 (tree) |
---|---|
Hora | 2016-10-14 05:03:56 |
Autor | Keith Marshall <keithmarshall@user...> |
Commiter | Keith Marshall |
Resolve some non-ANSI typedef omissions.
@@ -1,3 +1,14 @@ | ||
1 | +2016-10-13 Keith Marshall <keithmarshall@users.sourceforge.net> | |
2 | + | |
3 | + Resolve some non-ANSI typedef omissions. | |
4 | + | |
5 | + * include/sys/types.h (off_t, ssize_t): Always typedef them when... | |
6 | + [_POSIX_C_SOURCE || !_NO_OLDNAMES]: ...either of these prevails. | |
7 | + | |
8 | + * include/io.h (_fsize_t): Do not suppress its typedef when... | |
9 | + [__STRICT_ANSI__]: ...this compiler option applies, irrespective of... | |
10 | + [!(_IO_H && _WCHAR_H)]: ...this, which otherwise causes supression. | |
11 | + | |
1 | 12 | 2016-09-20 Keith Marshall <keithmarshall@users.sourceforge.net> |
2 | 13 | |
3 | 14 | Prepare and tag mingwrt-3.22.2 patch release. |
@@ -96,10 +96,10 @@ | ||
96 | 96 | /* We must define _fsize_t, but some compilers (including GCC prior to |
97 | 97 | * version 4.0), may choke if we try to do so more than once... |
98 | 98 | */ |
99 | -#if ! (defined _IO_H && defined _WCHAR_H) | |
99 | +#if ! (defined _IO_H && defined _WCHAR_H) || defined __STRICT_ANSI__ | |
100 | 100 | /* ...so DO NOT define it during direct <io.h> inclusion, (i.e. _IO_H |
101 | 101 | * is defined), if <wchar.h> has already caused it to be defined, (i.e. |
102 | - * _WCHAR_H is ALSO defined). | |
102 | + * _WCHAR_H is ALSO defined, but __STRICT_ANSI__ is NOT). | |
103 | 103 | */ |
104 | 104 | typedef unsigned long _fsize_t; |
105 | 105 | #endif /* ! (_IO_H && _WCHAR_H) */ |
@@ -66,15 +66,17 @@ | ||
66 | 66 | */ |
67 | 67 | typedef __off32_t _off_t; |
68 | 68 | |
69 | -# if _POSIX_C_SOURCE | |
69 | +# if _POSIX_C_SOURCE || ! defined _NO_OLDNAMES | |
70 | 70 | /* ...but note that this form should ALWAYS be preferred when |
71 | - * compiling POSIX compatible source code. | |
71 | + * compiling POSIX compatible source code, and should also be | |
72 | + * made generally available unless Microsoft's old names have | |
73 | + * been suppressed, (by defining _NO_OLDNAMES). | |
72 | 74 | */ |
73 | 75 | typedef _off_t off_t; |
74 | 76 | # endif |
75 | 77 | # if __GNUC__ < 4 |
76 | 78 | /* Some compilers, including GCC prior to v4, may get upset |
77 | - * if we try to specifiy these typedefs more than once. | |
79 | + * if we try to specify these typedefs more than once. | |
78 | 80 | */ |
79 | 81 | # define __have_typedef_off_t |
80 | 82 | # endif |
@@ -98,7 +100,7 @@ | ||
98 | 100 | |
99 | 101 | # if __GNUC__ < 4 |
100 | 102 | /* Some compilers, including GCC prior to v4, may get upset |
101 | - * if we try to specifiy these typedefs more than once. | |
103 | + * if we try to specify these typedefs more than once. | |
102 | 104 | */ |
103 | 105 | # define __have_typedef___off64_t |
104 | 106 | # endif |
@@ -112,15 +114,17 @@ | ||
112 | 114 | */ |
113 | 115 | typedef int _ssize_t; |
114 | 116 | |
115 | -# if _POSIX_C_SOURCE | |
117 | +# if _POSIX_C_SOURCE || ! defined _NO_OLDNAMES | |
116 | 118 | /* ...but note that this form should ALWAYS be preferred when |
117 | - * compiling POSIX compatible source code. | |
119 | + * compiling POSIX compatible source code, and should also be | |
120 | + * made generally available unless Microsoft's old names have | |
121 | + * been suppressed, (by defining _NO_OLDNAMES). | |
118 | 122 | */ |
119 | 123 | typedef _ssize_t ssize_t; |
120 | 124 | # endif |
121 | 125 | # if __GNUC__ < 4 |
122 | 126 | /* Some compilers, including GCC prior to v4, may get upset |
123 | - * if we try to specifiy these typedefs more than once. | |
127 | + * if we try to specify these typedefs more than once. | |
124 | 128 | */ |
125 | 129 | # define __have_typedef_ssize_t |
126 | 130 | # endif |