[PATCH] D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 9 06:14:37 PDT 2017


bruno added a comment.



> Thinking more about this, on Windows, is there a strong reason to default to a different libc by default on Windows?

I'm mostly concerned with `-fms-extensions` + darwin, which doesn't apply to this scenario, maybe someone else knows a better answer here.

> @bruno would reusing `-ffreestanding` work for you here?

I think forcing the use of `-ffreestanding` with Apple platforms just for this is too restrictive.

> Or is there something else that we can identify about the target environment that can indicate that the MS CRT is unavailable?  I think that what is weird to me about this is that this is not about compatibility with Visual Studio but about the underlying libc.  It feels like it would be similar in spirit to say that libc++ defaults to libSystem as the underlying libc on Linux.

Right, makes total sense. I'm assuming that `-fms-extensions` for other targets (Linux) will also rely in not using `_LIBCPP_MSVCRT`, however #ifdefing for other platforms here doens't seem to add much because they usually do not set `_MSC_VER` anyways. Additional ideas?


https://reviews.llvm.org/D34588





More information about the cfe-commits mailing list