On 22.01.2015 8:13, LRN wrote:
> On 21.01.2015 22:50, LRN wrote:
>> On 19.01.2015 16:12, Kai Tietz wrote:
>>> 2015-01-19 12:35 GMT+01:00 Jacek Caban wrote:
>>>> ---
>>>>  mingw-w64-headers/crt/sec_api/time_s.h | 62
>>>> ----------------------------------
>>>>  mingw-w64-headers/crt/time.h           | 31 +++++++++++++++--
>>>>  2 files changed, 29 insertions(+), 64 deletions(-)
>>>>  delete mode 100644 mingw-w64-headers/crt/sec_api/time_s.h
>>>>
>>> Patch looks ok to me.
>>>
>>> So, we should try to go this route for other "secured"-API, too.  We
>>> should try to emulate missing functions here in libmingwex.  by this
>>> we can remove the need for user to know what API is present on what OS
>>> ....
>>
>> This update breaks programs that include both time.h and wchar.h, which
>> includes sec_api/wchar_s.h, which declares _wctime_s, which is also declared 
>> in
>> time.h. This is because it's put in time.h under the guard of _INC_WTIME_INL
>> instead of _INC_WTIME_S_INL.
>>
> 
> Here's a patch that fixes this.
> 

And, of course, i've just stepped on the same rake... Here's a patch that
*actually* fixes this.

-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org
From 37bfdde961218d1a4b2e482e2448bf5b72f8e682 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
 =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1...@gmail.com>
Date: Thu, 22 Jan 2015 05:15:54 +0000
Subject: [PATCH] Separate _wctime_s from _wctime, put under its own
 _INC_WRIMTE_S_INL guard

---
 mingw-w64-headers/crt/time.h | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/mingw-w64-headers/crt/time.h b/mingw-w64-headers/crt/time.h
index e8f1008..b551a27 100644
--- a/mingw-w64-headers/crt/time.h
+++ b/mingw-w64-headers/crt/time.h
@@ -166,18 +166,27 @@ extern "C" {
 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
 #define _INC_WTIME_INL
   wchar_t *__cdecl _wctime(const time_t *) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
-  errno_t __cdecl _wctime_s(wchar_t *, size_t, const time_t *);
 #ifndef __CRT__NO_INLINE
 #ifndef _USE_32BIT_TIME_T
   __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return 
_wctime64(_Time); }
-  __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t 
_SizeInWords,const time_t *_Time) { return _wctime64_s 
(_Buffer,_SizeInWords,_Time); }
 #else
   __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return 
_wctime32(_Time); }
-  __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t 
_SizeInWords,const time_t *_Time) { return _wctime32_s 
(_Buffer,_SizeInWords,_Time); }
 #endif
 #endif /* __CRT__NO_INLINE */
 #endif
 
+#if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL)
+#define _INC_WTIME_S_INL
+  errno_t __cdecl _wctime_s(wchar_t *, size_t, const time_t *);
+#ifndef __CRT__NO_INLINE
+#ifndef _USE_32BIT_TIME_T
+  __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t 
_SizeInWords,const time_t *_Time) { return _wctime64_s 
(_Buffer,_SizeInWords,_Time); }
+#else
+  __CRT_INLINE errno_t __cdecl _wctime_s (wchar_t *_Buffer,size_t 
_SizeInWords,const time_t *_Time) { return _wctime32_s 
(_Buffer,_SizeInWords,_Time); }
+#endif
+#endif  /* __CRT__NO_INLINE */
+#endif
+
 #define _WTIME_DEFINED
 #endif
 
-- 
1.8.5.3

Attachment: 0x922360B0.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to