From: Corinna V. <vin...@re...> - 2012-06-26 13:19:29
|
Hi, for a start in supporting Cygwin, I created this patch. It doesn't error out just because _WIN32 is not defined and the new _cygwin.h file (which will probably get a lot more to do later on) just makes sure that _mingw.h does not define POSIX types. Additionally, I changed vadefs.h so that it doesn't test for _WIN32 at all. After all, it includes _mingw.h which runs this test anyway. Hope that's ok, Corinna mingw-w64-headers/ChangeLog: * configure.ac (BASEHEAD_LIST): Add _cygwin.h. * configure: Regenerate. mingw-w64-headers/crt/ChangeLog: * _cygwin.h: New file. * _mingw.h.in: Include _cygwin.h when building a Cygwin application. Allow building Cygwin applications even though _WIN32 isn't defined. * vadefs.h: Drop test for _WIN32 since it's done in _mingw.h. Index: mingw-w64-headers/configure.ac =================================================================== --- mingw-w64-headers/configure.ac (revision 5132) +++ mingw-w64-headers/configure.ac (working copy) @@ -41,7 +41,7 @@ # Checks for header files. -BASEHEAD_LIST="crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h +BASEHEAD_LIST="crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h for i in dlg h16 hxx rh ver; do BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i done Index: mingw-w64-headers/configure =================================================================== --- mingw-w64-headers/configure (revision 5132) +++ mingw-w64-headers/configure (working copy) @@ -2514,7 +2514,7 @@ # Checks for header files. -BASEHEAD_LIST="crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h +BASEHEAD_LIST="crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h for i in dlg h16 hxx rh ver; do BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i done Index: mingw-w64-headers/crt/_cygwin.h =================================================================== --- mingw-w64-headers/crt/_cygwin.h (revision 0) +++ mingw-w64-headers/crt/_cygwin.h (working copy) @@ -0,0 +1,26 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the w64 mingw-runtime package. + * No warranty is given; refer to the file DISCLAIMER.PD within this package. + */ +#ifndef _INC_CYGWIN +#define _INC_CYGWIN + +#ifndef __CYGWIN__ +#error Only Cygwin target is supported! +#endif + +/* Make sure that POSIX types are not defined by _mingw.h if we're building + for a Cygwin target. In this case we have to make sure to use the types + defined by the Cygwin/newlib headers. */ +#define _SIZE_T_DEFINED +#define _SSIZE_T_DEFINED +#define _INTPTR_T_DEFINED +#define _UINTPTR_T_DEFINED +#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 + +#endif /* _INC_CYGWIN */ Index: mingw-w64-headers/crt/vadefs.h =================================================================== --- mingw-w64-headers/crt/vadefs.h (revision 5132) +++ mingw-w64-headers/crt/vadefs.h (working copy) @@ -6,10 +6,6 @@ #ifndef _INC_VADEFS #define _INC_VADEFS -#ifndef _WIN32 -#error Only Win32 target is supported! -#endif - #include <_mingw.h> #ifndef __WIDL__ Index: mingw-w64-headers/crt/_mingw.h.in =================================================================== --- mingw-w64-headers/crt/_mingw.h.in (revision 5132) +++ mingw-w64-headers/crt/_mingw.h.in (working copy) @@ -12,6 +12,11 @@ #include "_mingw_mac.h" #include "_mingw_secapi.h" +/* Include _cygwin.h if we're building a Cygwin application. */ +#ifdef __CYGWIN__ +#include "_cygwin.h" +#endif + /* C/C++ specific language defines. */ #ifdef _WIN64 #ifdef __stdcall @@ -242,7 +247,7 @@ #endif /* __cplusplus */ #endif /* __GNUC__ */ -#ifndef _WIN32 +#if !defined(_WIN32) && !defined(__CYGWIN__) #error Only Win32 target is supported! #endif |
From: Kai T. <kti...@go...> - 2012-06-26 13:35:10
|
Hi Corinna, 2012/6/26 Corinna Vinschen <vin...@re...>: > Hi, > > for a start in supporting Cygwin, I created this patch. It doesn't > error out just because _WIN32 is not defined and the new _cygwin.h file > (which will probably get a lot more to do later on) just makes sure that > _mingw.h does not define POSIX types. > > Additionally, I changed vadefs.h so that it doesn't test for _WIN32 > at all. After all, it includes _mingw.h which runs this test anyway. > > > Hope that's ok, > Corinna > > > mingw-w64-headers/ChangeLog: > > * configure.ac (BASEHEAD_LIST): Add _cygwin.h. > * configure: Regenerate. > > mingw-w64-headers/crt/ChangeLog: > > * _cygwin.h: New file. > * _mingw.h.in: Include _cygwin.h when building a Cygwin application. > Allow building Cygwin applications even though _WIN32 isn't defined. > * vadefs.h: Drop test for _WIN32 since it's done in _mingw.h. > > > Index: mingw-w64-headers/configure.ac > =================================================================== > --- mingw-w64-headers/configure.ac (revision 5132) > +++ mingw-w64-headers/configure.ac (working copy) > @@ -41,7 +41,7 @@ > > # Checks for header files. > > -BASEHEAD_LIST="crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h > +BASEHEAD_LIST="crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h > for i in dlg h16 hxx rh ver; do > BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i > done > Index: mingw-w64-headers/configure > =================================================================== > --- mingw-w64-headers/configure (revision 5132) > +++ mingw-w64-headers/configure (working copy) > @@ -2514,7 +2514,7 @@ > > # Checks for header files. > > -BASEHEAD_LIST="crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h > +BASEHEAD_LIST="crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h > for i in dlg h16 hxx rh ver; do > BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i > done > Index: mingw-w64-headers/crt/_cygwin.h > =================================================================== > --- mingw-w64-headers/crt/_cygwin.h (revision 0) > +++ mingw-w64-headers/crt/_cygwin.h (working copy) > @@ -0,0 +1,26 @@ > +/** > + * This file has no copyright assigned and is placed in the Public Domain. > + * This file is part of the w64 mingw-runtime package. > + * No warranty is given; refer to the file DISCLAIMER.PD within this package. > + */ > +#ifndef _INC_CYGWIN > +#define _INC_CYGWIN > + > +#ifndef __CYGWIN__ > +#error Only Cygwin target is supported! > +#endif > + > +/* Make sure that POSIX types are not defined by _mingw.h if we're building > + for a Cygwin target. In this case we have to make sure to use the types > + defined by the Cygwin/newlib headers. */ > +#define _SIZE_T_DEFINED > +#define _SSIZE_T_DEFINED > +#define _INTPTR_T_DEFINED > +#define _UINTPTR_T_DEFINED > +#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 > + > +#endif /* _INC_CYGWIN */ > Index: mingw-w64-headers/crt/vadefs.h > =================================================================== > --- mingw-w64-headers/crt/vadefs.h (revision 5132) > +++ mingw-w64-headers/crt/vadefs.h (working copy) > @@ -6,10 +6,6 @@ > #ifndef _INC_VADEFS > #define _INC_VADEFS > > -#ifndef _WIN32 > -#error Only Win32 target is supported! > -#endif > - > #include <_mingw.h> > > #ifndef __WIDL__ > Index: mingw-w64-headers/crt/_mingw.h.in > =================================================================== > --- mingw-w64-headers/crt/_mingw.h.in (revision 5132) > +++ mingw-w64-headers/crt/_mingw.h.in (working copy) > @@ -12,6 +12,11 @@ > #include "_mingw_mac.h" > #include "_mingw_secapi.h" > > +/* Include _cygwin.h if we're building a Cygwin application. */ > +#ifdef __CYGWIN__ > +#include "_cygwin.h" > +#endif > + > /* C/C++ specific language defines. */ > #ifdef _WIN64 > #ifdef __stdcall > @@ -242,7 +247,7 @@ > #endif /* __cplusplus */ > #endif /* __GNUC__ */ > > -#ifndef _WIN32 > +#if !defined(_WIN32) && !defined(__CYGWIN__) > #error Only Win32 target is supported! > #endif Patch is ok. Just one question, about _cygwin.h header. Shouldn't this header simply check for definition of __CYGWIN___ as guard? So later one we don't need to guard include of _cygwin.h in _mingw.h header? Cheers, Kai |
From: Jacek C. <ja...@co...> - 2012-06-26 13:42:45
|
On 06/26/12 15:34, Kai Tietz wrote: > Hi Corinna, > > 2012/6/26 Corinna Vinschen <vin...@re...>: >> Hi, >> >> for a start in supporting Cygwin, I created this patch. It doesn't >> error out just because _WIN32 is not defined and the new _cygwin.h file >> (which will probably get a lot more to do later on) just makes sure that >> _mingw.h does not define POSIX types. >> >> Additionally, I changed vadefs.h so that it doesn't test for _WIN32 >> at all. After all, it includes _mingw.h which runs this test anyway. >> >> >> Hope that's ok, >> Corinna >> >> >> mingw-w64-headers/ChangeLog: >> >> * configure.ac (BASEHEAD_LIST): Add _cygwin.h. >> * configure: Regenerate. >> >> mingw-w64-headers/crt/ChangeLog: >> >> * _cygwin.h: New file. >> * _mingw.h.in: Include _cygwin.h when building a Cygwin application. >> Allow building Cygwin applications even though _WIN32 isn't defined. >> * vadefs.h: Drop test for _WIN32 since it's done in _mingw.h. >> >> >> Index: mingw-w64-headers/configure.ac >> =================================================================== >> --- mingw-w64-headers/configure.ac (revision 5132) >> +++ mingw-w64-headers/configure.ac (working copy) >> @@ -41,7 +41,7 @@ >> >> # Checks for header files. >> >> -BASEHEAD_LIST="crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h >> +BASEHEAD_LIST="crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h >> for i in dlg h16 hxx rh ver; do >> BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i >> done >> Index: mingw-w64-headers/configure >> =================================================================== >> --- mingw-w64-headers/configure (revision 5132) >> +++ mingw-w64-headers/configure (working copy) >> @@ -2514,7 +2514,7 @@ >> >> # Checks for header files. >> >> -BASEHEAD_LIST="crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h >> +BASEHEAD_LIST="crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h >> for i in dlg h16 hxx rh ver; do >> BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i >> done >> Index: mingw-w64-headers/crt/_cygwin.h >> =================================================================== >> --- mingw-w64-headers/crt/_cygwin.h (revision 0) >> +++ mingw-w64-headers/crt/_cygwin.h (working copy) >> @@ -0,0 +1,26 @@ >> +/** >> + * This file has no copyright assigned and is placed in the Public Domain. >> + * This file is part of the w64 mingw-runtime package. >> + * No warranty is given; refer to the file DISCLAIMER.PD within this package. >> + */ >> +#ifndef _INC_CYGWIN >> +#define _INC_CYGWIN >> + >> +#ifndef __CYGWIN__ >> +#error Only Cygwin target is supported! >> +#endif >> + >> +/* Make sure that POSIX types are not defined by _mingw.h if we're building >> + for a Cygwin target. In this case we have to make sure to use the types >> + defined by the Cygwin/newlib headers. */ >> +#define _SIZE_T_DEFINED >> +#define _SSIZE_T_DEFINED >> +#define _INTPTR_T_DEFINED >> +#define _UINTPTR_T_DEFINED >> +#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 >> + >> +#endif /* _INC_CYGWIN */ >> Index: mingw-w64-headers/crt/vadefs.h >> =================================================================== >> --- mingw-w64-headers/crt/vadefs.h (revision 5132) >> +++ mingw-w64-headers/crt/vadefs.h (working copy) >> @@ -6,10 +6,6 @@ >> #ifndef _INC_VADEFS >> #define _INC_VADEFS >> >> -#ifndef _WIN32 >> -#error Only Win32 target is supported! >> -#endif >> - >> #include <_mingw.h> >> >> #ifndef __WIDL__ >> Index: mingw-w64-headers/crt/_mingw.h.in >> =================================================================== >> --- mingw-w64-headers/crt/_mingw.h.in (revision 5132) >> +++ mingw-w64-headers/crt/_mingw.h.in (working copy) >> @@ -12,6 +12,11 @@ >> #include "_mingw_mac.h" >> #include "_mingw_secapi.h" >> >> +/* Include _cygwin.h if we're building a Cygwin application. */ >> +#ifdef __CYGWIN__ >> +#include "_cygwin.h" >> +#endif >> + >> /* C/C++ specific language defines. */ >> #ifdef _WIN64 >> #ifdef __stdcall >> @@ -242,7 +247,7 @@ >> #endif /* __cplusplus */ >> #endif /* __GNUC__ */ >> >> -#ifndef _WIN32 >> +#if !defined(_WIN32) && !defined(__CYGWIN__) >> #error Only Win32 target is supported! >> #endif > Patch is ok. Just one question, about _cygwin.h header. Shouldn't > this header simply check for definition of __CYGWIN___ as guard? So > later one we don't need to guard include of _cygwin.h in _mingw.h > header? Wouldn't simply adding !defined(__CYGWIN__) around problematic type declarations be cleaner than adding a new header that disables them in a bit hacky way? Is there any reason to have separated _cygwin.h file? (Just asking, I don't know further plans about Cygwin support). Jacek |
From: Kai T. <kti...@go...> - 2012-06-26 13:48:01
|
2012/6/26 Jacek Caban <ja...@co...>: > On 06/26/12 15:34, Kai Tietz wrote: >> Hi Corinna, >> >> 2012/6/26 Corinna Vinschen <vin...@re...>: >>> Hi, >>> >>> for a start in supporting Cygwin, I created this patch. It doesn't >>> error out just because _WIN32 is not defined and the new _cygwin.h file >>> (which will probably get a lot more to do later on) just makes sure that >>> _mingw.h does not define POSIX types. >>> >>> Additionally, I changed vadefs.h so that it doesn't test for _WIN32 >>> at all. After all, it includes _mingw.h which runs this test anyway. >>> >>> >>> Hope that's ok, >>> Corinna >>> >>> >>> mingw-w64-headers/ChangeLog: >>> >>> * configure.ac (BASEHEAD_LIST): Add _cygwin.h. >>> * configure: Regenerate. >>> >>> mingw-w64-headers/crt/ChangeLog: >>> >>> * _cygwin.h: New file. >>> * _mingw.h.in: Include _cygwin.h when building a Cygwin application. >>> Allow building Cygwin applications even though _WIN32 isn't defined. >>> * vadefs.h: Drop test for _WIN32 since it's done in _mingw.h. >>> >>> >>> Index: mingw-w64-headers/configure.ac >>> =================================================================== >>> --- mingw-w64-headers/configure.ac (revision 5132) >>> +++ mingw-w64-headers/configure.ac (working copy) >>> @@ -41,7 +41,7 @@ >>> >>> # Checks for header files. >>> >>> -BASEHEAD_LIST="crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h >>> +BASEHEAD_LIST="crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h >>> for i in dlg h16 hxx rh ver; do >>> BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i >>> done >>> Index: mingw-w64-headers/configure >>> =================================================================== >>> --- mingw-w64-headers/configure (revision 5132) >>> +++ mingw-w64-headers/configure (working copy) >>> @@ -2514,7 +2514,7 @@ >>> >>> # Checks for header files. >>> >>> -BASEHEAD_LIST="crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h >>> +BASEHEAD_LIST="crt/_cygwin.h crt/_mingw.h crt/_mingw_mac.h crt/_mingw_print_push.h crt/_mingw_print_pop.h crt/_mingw_secapi.h crt/_mingw_unicode.h crt/vadefs.h "$srcdir/include/*.h >>> for i in dlg h16 hxx rh ver; do >>> BASEHEAD_LIST="$BASEHEAD_LIST "$srcdir/include/*.$i >>> done >>> Index: mingw-w64-headers/crt/_cygwin.h >>> =================================================================== >>> --- mingw-w64-headers/crt/_cygwin.h (revision 0) >>> +++ mingw-w64-headers/crt/_cygwin.h (working copy) >>> @@ -0,0 +1,26 @@ >>> +/** >>> + * This file has no copyright assigned and is placed in the Public Domain. >>> + * This file is part of the w64 mingw-runtime package. >>> + * No warranty is given; refer to the file DISCLAIMER.PD within this package. >>> + */ >>> +#ifndef _INC_CYGWIN >>> +#define _INC_CYGWIN >>> + >>> +#ifndef __CYGWIN__ >>> +#error Only Cygwin target is supported! >>> +#endif >>> + >>> +/* Make sure that POSIX types are not defined by _mingw.h if we're building >>> + for a Cygwin target. In this case we have to make sure to use the types >>> + defined by the Cygwin/newlib headers. */ >>> +#define _SIZE_T_DEFINED >>> +#define _SSIZE_T_DEFINED >>> +#define _INTPTR_T_DEFINED >>> +#define _UINTPTR_T_DEFINED >>> +#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 >>> + >>> +#endif /* _INC_CYGWIN */ >>> Index: mingw-w64-headers/crt/vadefs.h >>> =================================================================== >>> --- mingw-w64-headers/crt/vadefs.h (revision 5132) >>> +++ mingw-w64-headers/crt/vadefs.h (working copy) >>> @@ -6,10 +6,6 @@ >>> #ifndef _INC_VADEFS >>> #define _INC_VADEFS >>> >>> -#ifndef _WIN32 >>> -#error Only Win32 target is supported! >>> -#endif >>> - >>> #include <_mingw.h> >>> >>> #ifndef __WIDL__ >>> Index: mingw-w64-headers/crt/_mingw.h.in >>> =================================================================== >>> --- mingw-w64-headers/crt/_mingw.h.in (revision 5132) >>> +++ mingw-w64-headers/crt/_mingw.h.in (working copy) >>> @@ -12,6 +12,11 @@ >>> #include "_mingw_mac.h" >>> #include "_mingw_secapi.h" >>> >>> +/* Include _cygwin.h if we're building a Cygwin application. */ >>> +#ifdef __CYGWIN__ >>> +#include "_cygwin.h" >>> +#endif >>> + >>> /* C/C++ specific language defines. */ >>> #ifdef _WIN64 >>> #ifdef __stdcall >>> @@ -242,7 +247,7 @@ >>> #endif /* __cplusplus */ >>> #endif /* __GNUC__ */ >>> >>> -#ifndef _WIN32 >>> +#if !defined(_WIN32) && !defined(__CYGWIN__) >>> #error Only Win32 target is supported! >>> #endif >> Patch is ok. Just one question, about _cygwin.h header. Shouldn't >> this header simply check for definition of __CYGWIN___ as guard? So >> later one we don't need to guard include of _cygwin.h in _mingw.h >> header? > > Wouldn't simply adding !defined(__CYGWIN__) around problematic type > declarations be cleaner than adding a new header that disables them in a > bit hacky way? Is there any reason to have separated _cygwin.h file? > (Just asking, I don't know further plans about Cygwin support). > > Jacek Well, I like the idea of the header disabling those guards explicit more. Also we need later on this header for some other issues we might get in context of 64-bit (LLP64 vs LP64). I think it is more confusing to have too often the macro-check iterant within standard-headers. But I admit that a comment at the place of disabled part could be helpful. Kai |
From: Corinna V. <vin...@re...> - 2012-06-26 14:02:19
|
On Jun 26 15:34, Kai Tietz wrote: > Hi Corinna, > > 2012/6/26 Corinna Vinschen <vin...@re...>: > > Hi, > > > > for a start in supporting Cygwin, I created this patch. It doesn't > > error out just because _WIN32 is not defined and the new _cygwin.h file > > (which will probably get a lot more to do later on) just makes sure that > > _mingw.h does not define POSIX types. > > > > Additionally, I changed vadefs.h so that it doesn't test for _WIN32 > > at all. After all, it includes _mingw.h which runs this test anyway. > > > > > > Hope that's ok, > > Corinna > > [...] > > Index: mingw-w64-headers/crt/_mingw.h.in > > =================================================================== > > --- mingw-w64-headers/crt/_mingw.h.in (revision 5132) > > +++ mingw-w64-headers/crt/_mingw.h.in (working copy) > > @@ -12,6 +12,11 @@ > > #include "_mingw_mac.h" > > #include "_mingw_secapi.h" > > > > +/* Include _cygwin.h if we're building a Cygwin application. */ > > +#ifdef __CYGWIN__ > > +#include "_cygwin.h" > > +#endif > > + > > /* C/C++ specific language defines. */ > > #ifdef _WIN64 > > #ifdef __stdcall > > @@ -242,7 +247,7 @@ > > #endif /* __cplusplus */ > > #endif /* __GNUC__ */ > > > > -#ifndef _WIN32 > > +#if !defined(_WIN32) && !defined(__CYGWIN__) > > #error Only Win32 target is supported! > > #endif > > Patch is ok. Just one question, about _cygwin.h header. Shouldn't > this header simply check for definition of __CYGWIN___ as guard? So > later one we don't need to guard include of _cygwin.h in _mingw.h > header? Matter of taste, I guess. Personally I'd prefer to see the #ifdef __CYGWIN__ and the preceeding comment in _mingw.h so it's crystal-clear for the observer of that file that the _cygwin.h header is not an essential requirement for non-Cygwin targets. Corinna |
From: Corinna V. <vin...@re...> - 2012-06-26 16:13:45
|
On Jun 26 16:02, Corinna Vinschen wrote: > On Jun 26 15:34, Kai Tietz wrote: > > Hi Corinna, > > > > 2012/6/26 Corinna Vinschen <vin...@re...>: > > > Hi, > > > > > > for a start in supporting Cygwin, I created this patch. It doesn't > > > error out just because _WIN32 is not defined and the new _cygwin.h file > > > (which will probably get a lot more to do later on) just makes sure that > > > _mingw.h does not define POSIX types. > > > > > > Additionally, I changed vadefs.h so that it doesn't test for _WIN32 > > > at all. After all, it includes _mingw.h which runs this test anyway. > > > > > > > > > Hope that's ok, > > > Corinna > > > [...] > > > Index: mingw-w64-headers/crt/_mingw.h.in > > > =================================================================== > > > --- mingw-w64-headers/crt/_mingw.h.in (revision 5132) > > > +++ mingw-w64-headers/crt/_mingw.h.in (working copy) > > > @@ -12,6 +12,11 @@ > > > #include "_mingw_mac.h" > > > #include "_mingw_secapi.h" > > > > > > +/* Include _cygwin.h if we're building a Cygwin application. */ > > > +#ifdef __CYGWIN__ > > > +#include "_cygwin.h" > > > +#endif > > > + > > > /* C/C++ specific language defines. */ > > > #ifdef _WIN64 > > > #ifdef __stdcall > > > @@ -242,7 +247,7 @@ > > > #endif /* __cplusplus */ > > > #endif /* __GNUC__ */ > > > > > > -#ifndef _WIN32 > > > +#if !defined(_WIN32) && !defined(__CYGWIN__) > > > #error Only Win32 target is supported! > > > #endif > > > > Patch is ok. Just one question, about _cygwin.h header. Shouldn't > > this header simply check for definition of __CYGWIN___ as guard? So > > later one we don't need to guard include of _cygwin.h in _mingw.h > > header? > > Matter of taste, I guess. Personally I'd prefer to see the > #ifdef __CYGWIN__ and the preceeding comment in _mingw.h so it's > crystal-clear for the observer of that file that the _cygwin.h header > is not an essential requirement for non-Cygwin targets. Patch applied. Thanks, Corinna |