headers: Always map e.g. time to _time32 or _time64 for ucrtbase

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ö <martin@martin.st>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
diff --git a/mingw-w64-headers/crt/time.h b/mingw-w64-headers/crt/time.h
index f956f6e..ac9afe8 100644
--- a/mingw-w64-headers/crt/time.h
+++ b/mingw-w64-headers/crt/time.h
@@ -211,6 +211,7 @@
 #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;
@@ -219,26 +220,32 @@
 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(_USE_32BIT_TIME_T)
-__CRT_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); }
+#if !defined(__CRT__NO_INLINE) || __MSVCRT_VERSION__ >= 0x1400
+#if __MSVCRT_VERSION__ >= 0x1400
+#define __TIME_INLINE __mingw_static_ovr
 #else
-__CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2)
+#define __TIME_INLINE __CRT_INLINE
+#endif
+#if !defined(_USE_32BIT_TIME_T)
+__TIME_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2)
+  { return _difftime64(_Time1,_Time2); }
+__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
+__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 */