File: upstream_Use-isatty-when-using-GNU-libc.patch

package info (click to toggle)
catch2 3.7.1-0.6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,296 kB
  • sloc: cpp: 50,696; python: 1,525; sh: 79; makefile: 18
file content (33 lines) | stat: -rw-r--r-- 1,303 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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