ucrtbase doesn't have any function named plain 'time'. Force these
to be remapped to the inline form even if inlining otherwise wouldn't
be done. Make sure that we don't keep any non-inline declaration,
because otherwise a caller that tries to take the function address
would end up referring to that.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-headers/crt/time.h | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/mingw-w64-headers/crt/time.h b/mingw-w64-headers/crt/time.h
index 7f5bbb7..3e989d5 100644
--- a/mingw-w64-headers/crt/time.h
+++ b/mingw-w64-headers/crt/time.h
@@ -200,6 +200,7 @@ extern "C" {
 #endif
 
 #ifndef RC_INVOKED
+#if __MSVCRT_VERSION__ < 0x1400
 double __cdecl difftime(time_t _Time1,time_t _Time2);
 char *__cdecl ctime(const time_t *_Time) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
 struct tm *__cdecl gmtime(const time_t *_Time) 
__MINGW_ATTRIB_DEPRECATED_SEC_WARN;
@@ -208,26 +209,32 @@ struct tm *__cdecl localtime(const time_t *_Time) 
__MINGW_ATTRIB_DEPRECATED_SEC_
 time_t __cdecl mktime(struct tm *_Tm);
 time_t __cdecl _mkgmtime(struct tm *_Tm);
 time_t __cdecl time(time_t *_Time);
+#endif
 
-#ifndef __CRT__NO_INLINE
+#if !defined(__CRT__NO_INLINE) || __MSVCRT_VERSION__ >= 0x1400
+#if __MSVCRT_VERSION__ >= 0x1400
+#define __TIME_INLINE __mingw_static_ovr
+#else
+#define __TIME_INLINE __CRT_INLINE
+#endif
 #if !defined(_USE_32BIT_TIME_T)
-__CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2)
+__TIME_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2)
   { return _difftime64(_Time1,_Time2); }
-__CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return 
_ctime64(_Time); }
-__CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return 
_gmtime64(_Time); }
-__CRT_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return 
_localtime64(_Time); }
-__CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime64(_Tm); }
-__CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return 
_mkgmtime64(_Tm); }
-__CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time64(_Time); }
+__TIME_INLINE char *__cdecl ctime(const time_t *_Time) { return 
_ctime64(_Time); }
+__TIME_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return 
_gmtime64(_Time); }
+__TIME_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return 
_localtime64(_Time); }
+__TIME_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime64(_Tm); }
+__TIME_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return 
_mkgmtime64(_Tm); }
+__TIME_INLINE time_t __cdecl time(time_t *_Time) { return _time64(_Time); }
 #else
-__CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2)
+__TIME_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2)
   { return _difftime32(_Time1,_Time2); }
-__CRT_INLINE char *__cdecl ctime(const time_t *_Time) { return 
_ctime32(_Time); }
-__CRT_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return 
_localtime32(_Time); }
-__CRT_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime32(_Tm); }
-__CRT_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return 
_gmtime32(_Time); }
-__CRT_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return 
_mkgmtime32(_Tm); }
-__CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time32(_Time); }
+__TIME_INLINE char *__cdecl ctime(const time_t *_Time) { return 
_ctime32(_Time); }
+__TIME_INLINE struct tm *__cdecl localtime(const time_t *_Time) { return 
_localtime32(_Time); }
+__TIME_INLINE time_t __cdecl mktime(struct tm *_Tm) { return _mktime32(_Tm); }
+__TIME_INLINE struct tm *__cdecl gmtime(const time_t *_Time) { return 
_gmtime32(_Time); }
+__TIME_INLINE time_t __cdecl _mkgmtime(struct tm *_Tm) { return 
_mkgmtime32(_Tm); }
+__TIME_INLINE time_t __cdecl time(time_t *_Time) { return _time32(_Time); }
 #endif /* !_USE_32BIT_TIME_T */
 #endif /* !__CRT__NO_INLINE */
 
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to