[libc++] Guard warning pragmas

This makes the GCC output even cleaner!

Reviewed By: ldionne, #libc

Spies: mstorsjo, Quuxplusone, Mordante, libcxx-commits

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

NOKEYCHECK=True
GitOrigin-RevId: a7c2a6289c22624f8b21b6c0e3f27047c4d4113d
diff --git a/src/future.cpp b/src/future.cpp
index 177fe75..07ae938 100644
--- a/src/future.cpp
+++ b/src/future.cpp
@@ -29,13 +29,9 @@
     return "future";
 }
 
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wswitch"
-#elif defined(__GNUC__) || defined(__GNUG__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wswitch"
-#endif
+_LIBCPP_DIAGNOSTIC_PUSH
+_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wswitch")
+_LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wswitch")
 
 string
 __future_error_category::message(int ev) const
@@ -58,11 +54,7 @@
     return string("unspecified future_errc value\n");
 }
 
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#elif defined(__GNUC__) || defined(__GNUG__)
-#pragma GCC diagnostic pop
-#endif
+_LIBCPP_DIAGNOSTIC_POP
 
 const error_category&
 future_category() noexcept