• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

The MinGW.org Windows System Libraries


Commit MetaInfo

Revision61dae35a3a310d8682e928473ffa9f74bf392162 (tree)
Time2013-09-20 00:32:57
AuthorEarnie Boyd <earnie@user...>
CommiterEarnie Boyd

Log Message

Resolve issues [#2021], [#2046] and [#2020].

Change Summary

Incremental Difference

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
11 RELEASE 4.1:
22
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+
318 2013-09-18 Earnie Boyd <earnie@users.sourceforge.net>
419
520 * include/unistd.h (ftruncate()): Guard with no __STRICT_ANSI__ [#2046].
--- a/include/_mingw.h
+++ b/include/_mingw.h
@@ -225,6 +225,12 @@
225225 #define __MINGW_GNUC_PREREQ(major, minor) \
226226 (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
227227
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+
228234 #ifdef __cplusplus
229235 # define __CRT_INLINE inline
230236 #else
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -410,13 +410,30 @@ _CRTIMP int __cdecl __MINGW_NOTHROW fseek (FILE*, long, int);
410410 _CRTIMP long __cdecl __MINGW_NOTHROW ftell (FILE*);
411411 _CRTIMP void __cdecl __MINGW_NOTHROW rewind (FILE*);
412412
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); }
420437
421438 #ifdef __USE_MINGW_FSEEK /* These are in libmingwex.a */
422439 /*
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -338,6 +338,7 @@ _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _set_abort_behavior (unsigned int,
338338 # define _WRITE_ABORT_MSG 1
339339 # define _CALL_REPORTFAULT 2
340340
341+#if __MINGW_MSVCR_PREREQ(80)
341342 typedef void
342343 (* _invalid_parameter_handler) (
343344 const wchar_t *,
@@ -346,6 +347,7 @@ typedef void
346347 unsigned int,
347348 uintptr_t);
348349 _invalid_parameter_handler _set_invalid_parameter_handler (_invalid_parameter_handler);
350+#endif
349351
350352 #ifndef _NO_OLDNAMES
351353
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -21,6 +21,7 @@
2121 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2222 * DEALINGS IN THE SOFTWARE.
2323 */
24+#ifndef __STRICT_ANSI__
2425 #ifndef _UNISTD_H
2526 #define _UNISTD_H
2627 #pragma GCC system_header
@@ -60,7 +61,6 @@ extern "C" {
6061 int __cdecl __MINGW_NOTHROW usleep(useconds_t useconds);
6162 #endif /* Not __NO_ISOCEXT */
6263
63-#ifndef __STRICT_ANSI__
6464 /* This is defined as a real library function to allow autoconf
6565 to verify its existence. */
6666 int ftruncate(int, off_t);
@@ -70,7 +70,6 @@ __CRT_INLINE int ftruncate(int __fd, off_t __length)
7070 return _chsize (__fd, __length);
7171 }
7272 #endif
73-#endif /* ndef __STRICT_ANSI__ */
7473
7574 #ifdef __cplusplus
7675 }
@@ -78,3 +77,4 @@ __CRT_INLINE int ftruncate(int __fd, off_t __length)
7877
7978 #undef __UNISTD_H_SOURCED__
8079 #endif /* _UNISTD_H */
80+#endif /* ndef __STRICT_ANSI__ */