From: SourceForge.net <no...@so...> - 2009-07-24 01:09:09
|
Patches item #2134161, was opened at 2008-09-28 09:41 Message generated for change (Comment added) made by ir0nh34d You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=2134161&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Roumen Petrov (rumen) Assigned to: Nobody/Anonymous (nobody) Summary: time64 functions and types for msvcrt >= 8.0 Initial Comment: Internet search for "localtime mingw" point to pages describing a problem with time functions. It seems to that issue isn't reported to mingw. Internet search for "localtime msdn" point to a page for MS VS 7.1. On the page exist links to VS 8.0 and 9.0. What is difference (msvcrt >= 8.0): In Visual C++ 2005, localtime is an inline function which evaluates to _localtime64, and time_t is equivalent to __time64_t. If you need to force the compiler to interpret time_t as the old 32-bit time_t, you can define _USE_32BIT_TIME_T. Doing this will cause localtime to evaluate to _localtime32. This is not recommended because your application may fail after January 19, 2038, and it is not allowed on 64-bit platforms. Also for v >= 8.0 msvcrt add some functions with _s suffix. Another problem is that MSDN don't descibe correctly "Compatibility" column in paragraph "Requirements". As example for localtime_s the pages show only VS 8.0 and 9.0, i.e. localtime_s is missing in 7.1. Comparing documentation for 7.1, 8.0 and 9.0 I note following differences: %asctime: + asctime_s (new 8.0) %ctime: ctime -> _ctime32 + _ctime32_s (new 8.0) + _ctime64_s (new 8.0) _wctime -> _wctime32 + _wctime32_s (new 8.0) + _wctime64_s (new 8.0) %difftime: difftime -> _difftime32 +_difftime64 (new 8.0) %_ftime: _ftime -> _ftime32 + _ftime32_s (new 8.0) + _ftime64_s (new 8.0) %_futime: _futime -> _futime32 %gmtime: gmtime -> _gmtime32 + _gmtime32_s (new 8.0) + _gmtime64_s (new 8.0) %localtime: localtime -> _localtime32 + _localtime32_s (new 8.0) + _localtime64_s (new 8.0) %mktime: mktime -> _mktime32 %_mkgmtime: (new 8.0) _mkgmtime inline for _mkgmtime64 + _mkgmtime32 (new 8.0) + _mkgmtime64 (new 8.0) %strdate: + _strdate_s (new 8.0) + _wstrdate_s (new 8.0) %strtime: + _strtime_s (new 8.0) + _wstrtime_s (new 8.0) %time time -> _time32 %_utime _utime -> _utime32 _wutime -> _wutime32 %timezone variales(now as functions): + _get_daylight (new 8.0) + _get_dstbias (new 8.0) + _get_timezone (new 8.0) + _get_tzname (new 8.0) ---------------------------------------------------------------------- >Comment By: Chris Sutcliffe (ir0nh34d) Date: 2009-07-23 21:09 Message: Comments? Is this good to include in mingwrt now? ---------------------------------------------------------------------- Comment By: Roumen Petrov (rumen) Date: 2009-07-22 06:53 Message: What about "mingw-head-20090207-msvcrt8_time64.patch" ? ---------------------------------------------------------------------- Comment By: Roumen Petrov (rumen) Date: 2009-02-07 13:04 Message: The last patch contain one line more in Makefile.in: "Testing runtime 8.0(time32) headers..." ---------------------------------------------------------------------- Comment By: Roumen Petrov (rumen) Date: 2009-02-07 12:57 Message: The new patch use _CRTALIAS(new define in _mingw.h), i.e. always inline and this resolve compiler problem with asm attribute and __USE_CRTIMP. I found two buggy function declaration in old patch(mingwrt-3.15.1-mingw32.patch) but I left attached just in case if someone would like to track changes or may be to use. File Added: mingw-head-20090207-msvcrt8_time64.patch ---------------------------------------------------------------------- Comment By: Roumen Petrov (rumen) Date: 2009-02-01 17:52 Message: I intentionally miss direct links but the first sentence point how to access pages: " Internet search for "localtime msdn" point to a page for MS VS 7.1. On the page exist links to VS 8.0 and 9.0. ..." and next in the request is information from those pages. What is missing in the patch: - timezone variables: I didn't found enough information to include in patch; - functions in library "oldnames" - pages lack this information, so I put a FIXME comment in the patch. As example for fstat(); - flag -ansi may be is not supported well. The patch pass internal test but I don't know how to implement "oldnames". About "__asm__": The declarations of new functions follow the existing declarations, i.e. I wrote the patch without to introduce new macros. I'm not aware of GCC problem dllimport+__asm__. May be because dllimport create more problems and I prefer to use auto import for mingw builds. The patch is not tested if __USE_CRTIMP is defined. Also I get some suggestion from mingw user list. I trust Danny and what about to use new define similar to existing one __CRT_INLINE plus attribute always_inline ? About changes in msvcrt.def.in. You may found my idea for "flexible msvcrt.def.in" as example here "http://marc.info/?l=mingw-users&m=122419474901294&w=2" . Also I could modify patch to use current syntax: #if ( __msvcr70__ || ... || __msvcr90d__) . ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2009-01-31 22:01 Message: I don't think your use of __asm__ renames as in: +_CRTIMP int __cdecl __MINGW_NOTHROW _utime (const char*, struct _utimbuf*) __asm__("__utime64"); will work if __USE_CRTIMP is defined. It could be made to work with a patch to gcc. Would not use of __inline__ functions to overide the prior declaration be better. Danny ---------------------------------------------------------------------- Comment By: Keith Marshall (keithmarshall) Date: 2009-01-31 17:24 Message: Roumen, You've clearly put a fair bit of effort into this, thanks. Can you please confirm that your reference source is exclusively MSDN, and also provide an appropriate ChangeLog entry, in the format described in the GNU Coding Standards. For future reference, this would likely have attracted quicker attention on the patch tracker, to which I've now moved it, rather than as a feature request. However, we do require the ChangeLog, before ultimate acceptance. ---------------------------------------------------------------------- Comment By: Roumen Petrov (rumen) Date: 2008-10-16 17:39 Message: I would like to propose for review the attached patch. File Added: mingwrt-3.15.1-mingw32.patch ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=302435&aid=2134161&group_id=2435 |