[PATCH] D31737: [libc++] Respect Windows Store app CRT restrictions

Shoaib Meenai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 5 22:00:29 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL299625: [libc++] Respect Windows Store app CRT restrictions (authored by smeenai).

Changed prior to commit:
  https://reviews.llvm.org/D31737?vs=94308&id=94317#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D31737

Files:
  libcxx/trunk/include/__config
  libcxx/trunk/include/cstdlib


Index: libcxx/trunk/include/cstdlib
===================================================================
--- libcxx/trunk/include/cstdlib
+++ libcxx/trunk/include/cstdlib
@@ -130,8 +130,10 @@
 using ::atexit;
 using ::exit;
 using ::_Exit;
+#ifndef _LIBCPP_WINDOWS_STORE_APP
 using ::getenv;
 using ::system;
+#endif
 using ::bsearch;
 using ::qsort;
 using ::abs;
Index: libcxx/trunk/include/__config
===================================================================
--- libcxx/trunk/include/__config
+++ libcxx/trunk/include/__config
@@ -211,6 +211,16 @@
 # if defined(_LIBCPP_MSVCRT)
 #   define _LIBCPP_HAS_QUICK_EXIT
 # endif
+
+// Some CRT APIs are unavailable to store apps
+#if defined(WINAPI_FAMILY)
+#include <winapifamily.h>
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) &&                      \
+    (!defined(WINAPI_PARTITION_SYSTEM) ||                                      \
+     !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM))
+#define _LIBCPP_WINDOWS_STORE_APP
+#endif
+#endif
 #endif // defined(_WIN32)
 
 #ifdef __sun__


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31737.94317.patch
Type: text/x-patch
Size: 1054 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170406/39420109/attachment.bin>


More information about the cfe-commits mailing list