[libcxx-commits] [PATCH] D79888: libc++: move checks for newlib to actually work
Mara Sophie Grosch via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Apr 7 21:06:27 PDT 2021
LittleFox94 updated this revision to Diff 335993.
LittleFox94 retitled this revision from "libc++: include unistd.h if available to get some preprocessor macros" to "libc++: move checks for newlib to actually work".
LittleFox94 edited the summary of this revision.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79888/new/
https://reviews.llvm.org/D79888
Files:
libcxx/include/__config
libcxx/include/fstream
libcxx/include/locale
Index: libcxx/include/locale
===================================================================
--- libcxx/include/locale
+++ libcxx/include/locale
@@ -203,8 +203,13 @@
#include <cstdlib>
#include <ctime>
#include <cstdio>
-#ifdef _LIBCPP_HAS_CATOPEN
-#include <nl_types.h>
+
+#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)
+# define _LIBCPP_HAS_CATOPEN 1
+# include <nl_types.h>
+# endif
#endif
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
Index: libcxx/include/fstream
===================================================================
--- libcxx/include/fstream
+++ libcxx/include/fstream
@@ -198,6 +198,11 @@
_LIBCPP_PUSH_MACROS
#include <__undef_macros>
+#if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
+# if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION)
+# define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
+# endif
+#endif
_LIBCPP_BEGIN_NAMESPACE_STD
Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -934,13 +934,6 @@
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
#endif
-#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)
-# define _LIBCPP_HAS_CATOPEN 1
-# endif
-#endif
-
#ifdef __FreeBSD__
#define _DECLARE_C99_LDBL_MATH 1
#endif
@@ -1312,12 +1305,6 @@
#define _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED
#endif
-#if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
-# if defined(_LIBCPP_MSVCRT) || defined(_NEWLIB_VERSION)
-# define _LIBCPP_HAS_NO_OFF_T_FUNCTIONS
-# endif
-#endif
-
#if __has_attribute(diagnose_if) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS)
# define _LIBCPP_DIAGNOSE_WARNING(...) \
__attribute__((diagnose_if(__VA_ARGS__, "warning")))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79888.335993.patch
Type: text/x-patch
Size: 2015 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210408/53034a6a/attachment.bin>
More information about the libcxx-commits
mailing list