[PATCH] [libcxx] Distinguish between MSVC, MSVCRT, and Windows-specific code

G M gmisocpp at gmail.com
Fri Aug 9 04:19:05 PDT 2013

The _LIBCPP_MSVCRT patch 187593 changed all occurances of _MSC_VER to
_LIBCPP_MSVCRT, but it also changed at least one instance (in cctype) of
#if _WIN32
#include "support\win32\support.h"
#include "support\win32\support.h"

So if we make the change you suggest Nico, of not defining _LIBCPP_MSVCRT
when __GNUC__ is defined, I'm thinking things will stil be broken because
support.h will no longer get included but that is still required for Win32
(which g++ and clang define).

If I am right about that, then because of that I think the best solution,
short of reverting the _LIBCPP_MSVCRT patch, is exactly NOT to add an #if
__GNUC__ test to __config, but just apply my patch as is.
Then the mental model is simpler. It says "when _LIBCPP_MSVCRT is defined,
(which currently is whenever _WIN32 is), any file inside the win32\support
folder will be processed and those files will do whatever they need to do
to enable libcxx to work on Windows with whatever compilers.

And each file will protect itself as needed to account for the appropriate
compilers and runtime's it handles. That's why my patch adds to yours.

As a related aside, I'm thinking that when clang-cl is tested, it too will
want to process these files and will define _MSC_VER but I don't know or
really have an opinion.

But my current view summed up is: a) apply my patch as is, or b) revert the
_LIBCPP_MSVCRT patch, or c) do something else if we do it fairly quickly
because right now it doesn't build.
After that, we should probably ask the question "where are we going with
these patches next?". It might help illuminate things. But I'd just apply
my patch to get things working then if anyone wants to have a discussion
about where "we" are going with libcxx on Windows, I'd be interested to
know who is interested in such a conversation.

Where to start that/join that conversation would be good to know too. I'm
sure it won't be on here. I don't know what value I could add to such a
conversation other than to suggest we should have one and that I'd be
interested in what other peoples views on the Windows evolvement of this
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130809/ad96f7ad/attachment.html>

More information about the cfe-commits mailing list