If I were a mingw-w64 committer, I probably wouldn't make that change, but I am OK with it. An argument in favor of that change is that it isn't too hard to just use sed or carefully-placed #defines to fix any Microsoft-style code that uses __in and __out. (It's not ideal, but not terrible.) And once we get libstdc++ to stop using those names, we could undo the change.
And if we do change mingw-w64, I agree the way to do it is to comment out the __in and __out lines in driverspecs.h, rather than reverting the patch I posted at the beginning of this thread. --David On Mon, May 15, 2017 at 1:57 AM, Mateusz <mateu...@poczta.onet.pl> wrote: > W dniu 2017-05-15 o 08:51, Liu Hao pisze: >> On 2017/5/11 23:11, Kai Tietz wrote: >>> I would prefer this too, but I don't believe that we can convince >>> libstdc++ maintainers to modify their code for this. Sadly the MS' >>> platform sdk defines a lot of stuff, which collides some times with >>> some projects. We made about this already a lot of bad experiences >>> ... especially in context of MIDL ... defining >>> IN/OUT/INOUT/OPTIONAL/etc is really no clever move ... >>> Nevertheless it might be worth a try to ask libstdc++ people for those >>> __in.... A good argument (and bad one too) might be that the double >>> underscore symbols are reserved to compilers/system headers. And >>> well, C++ headers aren't really system headers, which is in general >>> just a POV ;) >> I suggest we comment out `__in` and `__out` from _driverspecs.h_. The >> compatibility with GNU libstdc++ and LLVM libcxx is more essential than >> that with Windows in my opinion. > > +1 > >> >> These macros are defined after including _windows.h_ from official >> Windows SDK, as shown in this example: >> >> ------------------------------------------------------------ >> E:\Desktop>cat test.c >> #include <stdio.h> >> #include <windows.h> >> >> int main(){ >> #if defined(__in) >> puts("__in is defined."); >> #else >> puts("__in is not defined."); >> #endif >> } >> >> E:\Desktop>cl test.c /nologo /Fea.exe >> test.c >> >> E:\Desktop>cat test.c >> #include <stdio.h> >> #include <windows.h> >> >> int main(){ >> #if defined(__in) >> puts("__in is defined."); >> #else >> puts("__in is not defined."); >> #endif >> } >> >> E:\Desktop>cl test.c /nologo /Fe:a.exe >> test.c >> >> E:\Desktop>a.exe >> __in is defined. >> >> E:\Desktop>gcc test.c >> >> E:\Desktop>a.exe >> __in is not defined. >> ------------------------------------------------------------ >> >> > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Mingw-w64-public mailing list > Mingw-w64-public@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public