[libc++][nfc] Improve error diagnostics.

The error message for disabled filesystem and locale support is now done
in the same fashion as ranges and format in D106763.

Reviewed By: #libc, ldionne

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

GitOrigin-RevId: 4e65688571221565cf1a5c1e4bb58ee2ab7c9c83
diff --git a/include/filesystem b/include/filesystem
index 61d6c65..108fadd 100644
--- a/include/filesystem
+++ b/include/filesystem
@@ -253,7 +253,7 @@
 #endif
 
 #if defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
-# error "The Filesystem library is not supported by this configuration of libc++"
+# error "The Filesystem library is not supported since libc++ has been configured with LIBCXX_ENABLE_FILESYSTEM disabled"
 #endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/include/locale.h b/include/locale.h
index 65b2bd5..0b34134 100644
--- a/include/locale.h
+++ b/include/locale.h
@@ -36,7 +36,8 @@
 #include <__config>
 
 #if defined(_LIBCPP_HAS_NO_LOCALIZATION)
-#   error "Localization is not supported by this configuration of libc++"
+#error                                                                                                                 \
+    "The Localization library is not supported since libc++ has been configured with LIBCXX_ENABLE_LOCALIZATION disabled"
 #endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)