On 7/23/2013 17:57, JonY wrote:
> On 7/23/2013 17:03, Jacek Caban wrote:
>> On 07/20/13 03:57, JonY wrote:
>>> Hi,
>>>
>>> Cygwin errno.h does not define non-Posix errno_t, neither does Cygwin
>>> stdlib.h knows about _invalid_parameter_handler.
>>>
>>> In theory, any Cygwin code should not be using libmsvcrt.a at all, but
>>> this is currently a stopgap measure while I investigate how old the
>>> libmsvcrt.a inclusion goes.
>>
>> That's mostly a question to Cygwin devs, but don't they want -lmsvcrt to
>> work if someone really wants it? It would mean that we should provide
>> libmsvcrt.a in Cygwin builds.
>>
> 
> Sure, for now, libmsvcrt.a builds like normal for cygwin, just that it
> shouldn't really be used, since Cygwin CRT comes from newlib instead.
> 
>>> The attached patch OK to commit?
>>
>> configure.ac part seems unrelated to the problem. I think that's something 
>> for Corinna and/or NightStrike to review.
>>
> 
> It is, so on 64bit Cygwin, 64bit libs go into /lib instead of /lib64,
> lib is native bitness. This was written up before there were any
> concrete plans for 64bit Cygwin.
> 
>> The other part of the patch doesn't really need to introduce 
>> _INVALID_PARAMETER_HANDLER_DEFINED in a public header. You may simply remove 
>> stdlib.h include from invalid_parameter_handler.c and always typedef 
>> _invalid_parameter_handler or simly use void* instead of 
>> _invalid_parameter_handler. BTW, indeally our crt libs should use our crt 
>> headers on Cygwin builds, IMO. That would solve similar problems, but I 
>> guess that would be tricky (I haven't done any Cygwin builds myself, so I 
>> don't know much about them).
> 
> Simply adding the typedefs looks to be the simplest fix. As mentioned
> earlier, Cygwin has its own CRT, the mingw-w64 parts are used for win32
> APIs.
> 
> 

New patch attached.

Index: mingw-w64-headers/crt/_cygwin.h
===================================================================
--- mingw-w64-headers/crt/_cygwin.h     (revision 5961)
+++ mingw-w64-headers/crt/_cygwin.h     (working copy)
@@ -23,7 +23,6 @@
 #define _PTRDIFF_T_DEFINED
 #define _WCHAR_T_DEFINED
 #define _WCTYPE_T_DEFINED
-#define _ERRCODE_DEFINED       /* FIXME?  errno_t is no POSIX type. */
 #define _TIME_T_DEFINED
 
 /* _WIN64 is defined by the compiler specs when targeting Windows.
Index: mingw-w64-crt/configure.ac
===================================================================
--- mingw-w64-crt/configure.ac  (revision 5961)
+++ mingw-w64-crt/configure.ac  (working copy)
@@ -118,24 +118,26 @@
   AS_IF([AS_VAR_TEST_SET([LIB32]) || AS_VAR_TEST_SET([LIB64])],
     [AC_MSG_WARN([Building the runtime to use libce with lib32 or lib64 is 
unsupported.])])])
 
-AS_CASE([$enable_w32api],
-  [yes],[
-           AC_SUBST([LIB64SUFFIXDIR],[lib64/w32api])
-           AC_SUBST([LIB32SUFFIXDIR],[lib/w32api])
-       ],
-  [AS_CASE([$host_cpu],
-         [x86_64],[
-           AC_SUBST([LIB64SUFFIXDIR],[lib])
-           AC_SUBST([LIB32SUFFIXDIR],[lib32])],
-         [i*86],[
-           AC_SUBST([LIB64SUFFIXDIR],[lib64])
-           AC_SUBST([LIB32SUFFIXDIR],[lib])],
-         [
-           AC_SUBST([LIB64SUFFIXDIR],[lib64])
-           AC_SUBST([LIB32SUFFIXDIR],[lib32])]
-         )]
+AS_CASE([$host_cpu],
+  [x86_64],[
+    lib64suffx=lib
+    lib32suffx=lib32],
+  [i*86],[
+    lib64suffx=lib64
+    lib32suffx=lib],
+  [
+    lib64suffx=lib64
+    lib32suffx=lib32]
 )
 
+AS_VAR_IF([enable_w32api],[yes],[
+  lib64suffx=$lib64suffx/w32api
+  lib32suffx=$lib32suffx/w32api
+])
+
+AC_SUBST([LIB64SUFFIXDIR],[$lib64suffx])
+AC_SUBST([LIB32SUFFIXDIR],[$lib32suffx])
+
 # Checks for features.
 
 AC_MSG_CHECKING([whether to enable globbing])
Index: mingw-w64-crt/misc/invalid_parameter_handler.c
===================================================================
--- mingw-w64-crt/misc/invalid_parameter_handler.c      (revision 5961)
+++ mingw-w64-crt/misc/invalid_parameter_handler.c      (working copy)
@@ -1,6 +1,6 @@
 #include <windows.h>
-#include <stdlib.h>
 
+typedef void (__cdecl *_invalid_parameter_handler)(const wchar_t *,const 
wchar_t *,const wchar_t *,unsigned int,uintptr_t);
 static _invalid_parameter_handler handler;
 
 static _invalid_parameter_handler __cdecl 
mingw_set_invalid_parameter_handler(_invalid_parameter_handler new_handler)

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to