halyavin added a comment.
Here is how we solved this problem in our libc++ fork:
#define _LIBCPP_UCRT_INCLUDE(x) <../ucrt/x>
#define _LIBCPP_MSVC_INCLUDE(x) <../../VC/include/x>
#ifdef _LIBCPP_COMPILER_MSVC
#include _LIBCPP_UCRT_INCLUDE(wchar.h)
#else
#include_next <wchar.h>
#endif
As far as I understand neither solution resolves the problem with original
paths not excluded. Watch out for cycling dependencies created by MSVC includes
using other includes which point right back to libc++ instead.
Also, there is a problem with errno macro. I solved it like this:
#ifdef _LIBCPP_COMPILER_MSVC
// errno is defined in several files so we can't use #ifndef errno here
#ifdef errno
// undefine errno to avoid substitution in errno.h include file name.
#pragma push_macro("errno")
#undef errno
#include _LIBCPP_UCRT_INCLUDE(errno.h)
#pragma pop_macro("errno")
#else
#include _LIBCPP_UCRT_INCLUDE(errno.h)
#endif
#else
#include_next <errno.h>
#endif
https://reviews.llvm.org/D32411
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits