Author: Pino Toscano <toscano.pino@tiscali.it>
Description: Use isatty() when using GNU libc
 While isatty() is a POSIX interface and theoretically could be used
 more broadly than on Linux and macOS, use a conservative approach and
 use it on any platform that uses GNU libc.
 .
 Manually apply the change also to the "amalgamated" header.
Last-Update: 2024-10-19
Forwarded: https://github.com/catchorg/Catch2/pull/2922
Applied-Upstream: https://github.com/catchorg/Catch2/commit/a6ee7e20cd4011129816df7992c1a9db2ef4b58f

--- a/src/catch2/internal/catch_console_colour.cpp
+++ b/src/catch2/internal/catch_console_colour.cpp
@@ -161,7 +161,7 @@ namespace {
 #endif // Windows/ ANSI/ None
 
 
-#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC )
+#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) || defined( __GLIBC__ )
 #    define CATCH_INTERNAL_HAS_ISATTY
 #    include <unistd.h>
 #endif
--- a/extras/catch_amalgamated.cpp
+++ b/extras/catch_amalgamated.cpp
@@ -3516,7 +3516,7 @@ namespace {
 #endif // Windows/ ANSI/ None
 
 
-#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC )
+#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC ) || defined( __GLIBC__ )
 #    define CATCH_INTERNAL_HAS_ISATTY
 #    include <unistd.h>
 #endif
