I noticed an issue when compiling some C++ code that made use of localtime_r(): 
localtime_r() and related prototypes near the bottom of time.h are not in an 
'extern "C"' block. I worked around the issue, but perhaps a change to the 
source would be useful:
--- /mingw32/i686-w64-mingw32/include/time.h.ORIG 2016-02-03 02:28:03.000000000 
-0600
+++ /mingw32/i686-w64-mingw32/include/time.h 2016-02-19 17:24:19.883630900 -0600
@@ -266,6 +266,9 @@
#endif

#ifdef _POSIX_THREAD_SAFE_FUNCTIONS
+#ifdef __cplusplus
+extern "C" {
+#endif
__forceinline struct tm *__cdecl localtime_r(const time_t *_Time, struct tm 
*_Tm) {
return localtime_s(_Tm, _Time) ? NULL : _Tm;
}
@@ -278,6 +281,9 @@
__forceinline char *__cdecl asctime_r(const struct tm *_Tm, char * _Str) {
return asctime_s(_Str, 0x7fffffff, _Tm) ? NULL : _Str;
}
+#ifdef __cplusplus
+}
+#endif
#endif

/* Adding timespec definition. */
------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to