The MinGW.org Windows System Libraries
Revision | 61dae35a3a310d8682e928473ffa9f74bf392162 (tree) |
---|---|
Time | 2013-09-20 00:32:57 |
Author | Earnie Boyd <earnie@user...> |
Commiter | Earnie Boyd |
Resolve issues [#2021], [#2046] and [#2020].
@@ -1,5 +1,20 @@ | ||
1 | 1 | RELEASE 4.1: |
2 | 2 | |
3 | +2013-09-19 Earnie Boyd <earnie@users.sourceforge.net> | |
4 | + | |
5 | + * include/stdio.h (_fseeki64): Remove import and create alias [#2021]. | |
6 | + (_ftelli64): Ditto. | |
7 | + (_fseeki64_nolock): Ditto. | |
8 | + (_ftelli64_nolock): Ditto. | |
9 | + (_fseek_nolock): Ditto. | |
10 | + (_ftell_nolock): Ditto. | |
11 | + * include/unistd.h: Guard entire file not just the functions w.r.t. | |
12 | + __STRICT_ANSI__ [#2046]. | |
13 | + * include/_mingw.h (__MINGW_MSVCR_PREREQ()): New macro to determine | |
14 | + if we are using a versioned MSVCR## library. | |
15 | + * include/stdlib.h (_set_invalid_parameter_handler): Guard for MSVCR80 | |
16 | + or greater [#2020]. | |
17 | + | |
3 | 18 | 2013-09-18 Earnie Boyd <earnie@users.sourceforge.net> |
4 | 19 | |
5 | 20 | * include/unistd.h (ftruncate()): Guard with no __STRICT_ANSI__ [#2046]. |
@@ -225,6 +225,12 @@ | ||
225 | 225 | #define __MINGW_GNUC_PREREQ(major, minor) \ |
226 | 226 | (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) |
227 | 227 | |
228 | +/* This will be used to determine if we are using a MSVC versioned library | |
229 | + * that provides the symbols being declared. This could potentially be set | |
230 | + * by GCC eventually based on use switch of -msvc=xx or something similar. */ | |
231 | +#define __MINGW_MSVCR_PREREQ(runtime) \ | |
232 | + (defined(__MSVC_RUNTIME__) && (__MSVC_RUNTIME__ >= (runtime))) | |
233 | + | |
228 | 234 | #ifdef __cplusplus |
229 | 235 | # define __CRT_INLINE inline |
230 | 236 | #else |
@@ -410,13 +410,30 @@ _CRTIMP int __cdecl __MINGW_NOTHROW fseek (FILE*, long, int); | ||
410 | 410 | _CRTIMP long __cdecl __MINGW_NOTHROW ftell (FILE*); |
411 | 411 | _CRTIMP void __cdecl __MINGW_NOTHROW rewind (FILE*); |
412 | 412 | |
413 | -_CRTIMP int __cdecl __MINGW_NOTHROW _fseek_nolock (FILE*, long, int); | |
414 | -_CRTIMP long __cdecl __MINGW_NOTHROW _ftell_nolock (FILE*); | |
415 | - | |
416 | -_CRTIMP int __cdecl __MINGW_NOTHROW _fseeki64 (FILE*, __int64, int); | |
417 | -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _ftelli64 (FILE*); | |
418 | -_CRTIMP int __cdecl __MINGW_NOTHROW _fseeki64_nolock (FILE*, __int64, int); | |
419 | -_CRTIMP __int64 __cdecl __MINGW_NOTHROW _ftelli64_nolock (FILE*); | |
413 | +/* The _nolock is supposed to be nonlocking thread versions, they do not exist | |
414 | + * in msvcrt.dll. */ | |
415 | +int __cdecl __MINGW_NOTHROW _fseek_nolock (FILE*, long, int); | |
416 | +_CRTALIAS int __cdecl __MINGW_NOTHROW _fseek_nolock(FILE *stream, long offset, int whence) | |
417 | +{ return fseek(stream, offset, whence); } | |
418 | +long __cdecl __MINGW_NOTHROW _ftell_nolock (FILE*); | |
419 | +_CRTALIAS long __cdecl __MINGW_NOTHROW _ftell_nolock(FILE *stream) | |
420 | +{ return ftell(stream); } | |
421 | + | |
422 | +int __cdecl __MINGW_NOTHROW _fseeki64 (FILE*, __int64, int); | |
423 | +_CRTALIAS int __cdecl __MINGW_NOTHROW _fseeki64( FILE *stream, __int64 offset, int whence) | |
424 | +{ return _lseeki64(_fileno(stream), offset, whence);} | |
425 | +__int64 __cdecl __MINGW_NOTHROW _ftelli64 (FILE*); | |
426 | +_CRTALIAS __int64 __cdecl __MINGW_NOTHROW _ftelli64(FILE *stream) | |
427 | +{ return _telli64(_fileno(stream)); } | |
428 | + | |
429 | +/* The _nolock is supposed to be nonlocking thread versions, they do not exist | |
430 | + * in msvcrt.dll. */ | |
431 | +int __cdecl __MINGW_NOTHROW _fseeki64_nolock (FILE*, __int64, int); | |
432 | +_CRTALIAS int _fseeki64_nolock (FILE *stream, __int64 offset, int whence) | |
433 | +{ return _fseeki64(stream, offset, whence); } | |
434 | +__int64 __cdecl __MINGW_NOTHROW _ftelli64_nolock (FILE*); | |
435 | +_CRTALIAS __int64 __cdecl __MINGW_NOTHROW _ftelli64_nolock (FILE *stream) | |
436 | +{ return _ftelli64(stream); } | |
420 | 437 | |
421 | 438 | #ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */ |
422 | 439 | /* |
@@ -338,6 +338,7 @@ _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int, | ||
338 | 338 | # define _WRITE_ABORT_MSG 1 |
339 | 339 | # define _CALL_REPORTFAULT 2 |
340 | 340 | |
341 | +#if __MINGW_MSVCR_PREREQ(80) | |
341 | 342 | typedef void |
342 | 343 | (* _invalid_parameter_handler) ( |
343 | 344 | const wchar_t *, |
@@ -346,6 +347,7 @@ typedef void | ||
346 | 347 | unsigned int, |
347 | 348 | uintptr_t); |
348 | 349 | _invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler); |
350 | +#endif | |
349 | 351 | |
350 | 352 | #ifndef _NO_OLDNAMES |
351 | 353 |
@@ -21,6 +21,7 @@ | ||
21 | 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
22 | 22 | * DEALINGS IN THE SOFTWARE. |
23 | 23 | */ |
24 | +#ifndef __STRICT_ANSI__ | |
24 | 25 | #ifndef _UNISTD_H |
25 | 26 | #define _UNISTD_H |
26 | 27 | #pragma GCC system_header |
@@ -60,7 +61,6 @@ extern "C" { | ||
60 | 61 | int __cdecl __MINGW_NOTHROW usleep(useconds_t useconds); |
61 | 62 | #endif /* Not __NO_ISOCEXT */ |
62 | 63 | |
63 | -#ifndef __STRICT_ANSI__ | |
64 | 64 | /* This is defined as a real library function to allow autoconf |
65 | 65 | to verify its existence. */ |
66 | 66 | int ftruncate(int, off_t); |
@@ -70,7 +70,6 @@ __CRT_INLINE int ftruncate(int __fd, off_t __length) | ||
70 | 70 | return _chsize (__fd, __length); |
71 | 71 | } |
72 | 72 | #endif |
73 | -#endif /* ndef __STRICT_ANSI__ */ | |
74 | 73 | |
75 | 74 | #ifdef __cplusplus |
76 | 75 | } |
@@ -78,3 +77,4 @@ __CRT_INLINE int ftruncate(int __fd, off_t __length) | ||
78 | 77 | |
79 | 78 | #undef __UNISTD_H_SOURCED__ |
80 | 79 | #endif /* _UNISTD_H */ |
80 | +#endif /* ndef __STRICT_ANSI__ */ |