[libcxx-commits] [libcxx] b86771a - [libc++] Minor emscripten changes from downstream

Sam Clegg via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 28 06:44:53 PDT 2022


Author: Sam Clegg
Date: 2022-05-28T06:44:27-07:00
New Revision: b86771a2f780accf327ecfe163a3bf0f4814b628

URL: https://github.com/llvm/llvm-project/commit/b86771a2f780accf327ecfe163a3bf0f4814b628
DIFF: https://github.com/llvm/llvm-project/commit/b86771a2f780accf327ecfe163a3bf0f4814b628.diff

LOG: [libc++] Minor emscripten changes from downstream

Differential Revision: https://reviews.llvm.org/D126583

Added: 
    

Modified: 
    libcxx/include/__config
    libcxx/include/__locale
    libcxx/include/locale
    libcxx/src/include/config_elast.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__config b/libcxx/include/__config
index 62b367167637f..14e6850ebdc10 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -353,7 +353,7 @@
 #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
     defined(__OpenBSD__) || defined(__DragonFly__) || defined(__sun__)
 #  define _LIBCPP_USING_ARC4_RANDOM
-#elif defined(__wasi__)
+#elif defined(__wasi__) || defined(__EMSCRIPTEN__)
 #  define _LIBCPP_USING_GETENTROPY
 #elif defined(__Fuchsia__)
 #  define _LIBCPP_USING_FUCHSIA_CPRNG
@@ -1028,7 +1028,8 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
       defined(__APPLE__) || \
       defined(__sun__) || \
       defined(__MVS__) || \
-      defined(_AIX)
+      defined(_AIX) || \
+      defined(__EMSCRIPTEN__)
 #    define _LIBCPP_HAS_THREAD_API_PTHREAD
 #  elif defined(__Fuchsia__)
      // TODO(44575): Switch to C11 thread API when possible.

diff  --git a/libcxx/include/__locale b/libcxx/include/__locale
index 9fd707c7651ca..5198178aa758e 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -33,8 +33,7 @@
 # include <__support/newlib/xlocale.h>
 #elif defined(__OpenBSD__)
 # include <__support/openbsd/xlocale.h>
-#elif (defined(__APPLE__)      || defined(__FreeBSD__) \
-    || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
+#elif (defined(__APPLE__) || defined(__FreeBSD__) || defined(__IBMCPP__))
 # include <xlocale.h>
 #elif defined(__Fuchsia__)
 # include <__support/fuchsia/xlocale.h>

diff  --git a/libcxx/include/locale b/libcxx/include/locale
index 879f4d9820c96..3bed47c071e5b 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -211,7 +211,7 @@ template <class charT> class messages_byname;
 
 #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
 // Most unix variants have catopen.  These are the specific ones that don't.
-#  if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
+#  if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__)
 #    define _LIBCPP_HAS_CATOPEN 1
 #    include <nl_types.h>
 #  endif

diff  --git a/libcxx/src/include/config_elast.h b/libcxx/src/include/config_elast.h
index 0ed53a3b20d12..bef26ec5019ec 100644
--- a/libcxx/src/include/config_elast.h
+++ b/libcxx/src/include/config_elast.h
@@ -29,6 +29,8 @@
 // No _LIBCPP_ELAST needed on Fuchsia
 #elif defined(__wasi__)
 // No _LIBCPP_ELAST needed on WASI
+#elif defined(__EMSCRIPTEN__)
+// No _LIBCPP_ELAST needed on Emscripten
 #elif defined(__linux__) || defined(_LIBCPP_HAS_MUSL_LIBC)
 #define _LIBCPP_ELAST 4095
 #elif defined(__APPLE__)


        


More information about the libcxx-commits mailing list