[libc++] Move everything related solely to _LIBCPP_ASSERT to its own file
This is the first step towards disentangling the debug mode and assertions
in libc++. This patch doesn't make any functional change: it simply moves
_LIBCPP_ASSERT-related stuff to its own file so as to make it clear that
libc++ assertions and the debug mode are different things. Future patches
will make it possible to enable assertions without enabling the debug
mode.
Differential Revision: https://reviews.llvm.org/D119769
NOKEYCHECK=True
GitOrigin-RevId: f87aa19be64499308fc18f92d048c5fa2d3064d9
diff --git a/src/filesystem/directory_iterator.cpp b/src/filesystem/directory_iterator.cpp
index c9294f7..8b91929 100644
--- a/src/filesystem/directory_iterator.cpp
+++ b/src/filesystem/directory_iterator.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include <__assert>
#include <__config>
#include <errno.h>
#include <filesystem>
diff --git a/src/filesystem/filesystem_common.h b/src/filesystem/filesystem_common.h
index 9415356..c98d144 100644
--- a/src/filesystem/filesystem_common.h
+++ b/src/filesystem/filesystem_common.h
@@ -9,6 +9,7 @@
#ifndef FILESYSTEM_COMMON_H
#define FILESYSTEM_COMMON_H
+#include <__assert>
#include <__config>
#include <array>
#include <chrono>
diff --git a/src/filesystem/operations.cpp b/src/filesystem/operations.cpp
index 57e2539..0e2ebdf 100644
--- a/src/filesystem/operations.cpp
+++ b/src/filesystem/operations.cpp
@@ -6,6 +6,7 @@
//
//===----------------------------------------------------------------------===//
+#include <__assert>
#include <__utility/unreachable.h>
#include <array>
#include <climits>
diff --git a/src/filesystem/posix_compat.h b/src/filesystem/posix_compat.h
index 6cd6650..36116ec 100644
--- a/src/filesystem/posix_compat.h
+++ b/src/filesystem/posix_compat.h
@@ -23,6 +23,7 @@
#ifndef POSIX_COMPAT_H
#define POSIX_COMPAT_H
+#include <__assert>
#include <filesystem>
#include "filesystem_common.h"