D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

Erik Schwiebert via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 13 08:34:54 PDT 2017


These hypothetical targets aren’t so hypothetical.  Office for Mac and iOS uses code ported from Windows but actually targeted at running on the Apple (Darwin) platform. We don’t have the MSVC CRT there. 😊 

Schwieb

-----Original Message-----
From: Reid Kleckner via Phabricator [mailto:reviews at reviews.llvm.org] 
Sent: Thursday, July 13, 2017 8:31 AM
To: bruno.cardoso at gmail.com; eric at efcs.ca; mclow.lists at gmail.com; dexonsmith at apple.com; ben.craig at gmail.com; smeenai at fb.com; compnerd at compnerd.org; david.majnemer at gmail.com
Cc: geek4civic at gmail.com; Erik Schwiebert <eriksc at microsoft.com>; cfe-commits at lists.llvm.org
Subject: [PATCH] D34588: Check for _MSC_VER before define _LIBCPP_MSVCRT

rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

> Some non-windows targets using MS extensions define _WIN32 for compatibility with Windows but do not have MSVC compatibility.

So, these hypothetical targets have the Win32 API available, but they do not use the MSVC CRT, correct? They could use musl, or some custom C runtime, but they don't want libc++ to aim for MSVCRT compatibility.

---

In any case, checking _MSC_VER is the best thing I can think of for guessing if the MSVC CRT is going to be present, so this looks good.


https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Freviews.llvm.org%2FD34588&data=02%7C01%7Ceriksc%40microsoft.com%7C55099ebc746b4a80da4408d4ca042b95%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636355566643019338&sdata=n7xbFct8h7QlnsjjZifZYX72qqpzSG%2FpUAZEKbRbVY0%3D&reserved=0





More information about the cfe-commits mailing list