[PATCH] D33082: Fix Libc++ build with MinGW64
Saleem Abdulrasool via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun May 14 12:33:05 PDT 2017
compnerd requested changes to this revision.
compnerd added inline comments.
This revision now requires changes to proceed.
================
Comment at: include/__locale:370
static const mask blank = _ISblank;
-#elif defined(_LIBCPP_MSVCRT)
+#elif defined(_LIBCPP_WIN32API)
typedef unsigned short mask;
----------------
Are these really Win32? These are really more libc compatibility things I thought?
================
Comment at: include/stdio.h:113
// snprintf
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_WIN32API)
extern "C" {
----------------
Again, I dont think that this is Win32 API related. This is a libc implementation detail. If I were to build libc++ against musl and Win32, these would be present, right?
================
Comment at: include/wchar.h:169
-#if defined(__cplusplus) && defined(_LIBCPP_MSVCRT)
+#if defined(__cplusplus) && defined(_LIBCPP_WIN32API) // Needed in MinGW as well
extern "C" {
----------------
Again not sure that this is Win32 API specific.
================
Comment at: src/new.cpp:186
void* p;
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_WIN32API)
while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
----------------
This is definitely msvcrt specific. It is possible for an alternate c library to provide definitions here.
================
Comment at: src/new.cpp:259
if (ptr)
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_WIN32API)
::_aligned_free(ptr);
----------------
Part of the change above.
================
Comment at: src/support/win32/locale_win32.cpp:125
+
+#ifndef _LIBCPP_MSVCRT
+float strtof_l(const char* nptr, char** endptr, locale_t loc) {
----------------
Would you mind using:
#if !defined(_LIBCPP_MSVCRT)
instead?
================
Comment at: src/system_error.cpp:68
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_WIN32API)
string do_strerror_r(int ev) {
----------------
I think that MSVCRT is more appropriate here.
https://reviews.llvm.org/D33082
More information about the cfe-commits
mailing list