[committed] libstdc++: Fix bootstrap on AIX due to fileno macro

Message ID 20231217000341.2325821-1-jwakely@redhat.com
State Committed
Commit 1f7acbf04296e4d2553570642d7290d56b99228f
Headers
Series [committed] libstdc++: Fix bootstrap on AIX due to fileno macro |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 warning Patch is already merged

Commit Message

Jonathan Wakely Dec. 17, 2023, 12:03 a.m. UTC
  Tested x86_64-linux (and built on AIX). Pushed to trunk.

-- >8 --

On AIX fileno is a function-like macro, so enclose the name in
parentheses to ensure we use the real function.

libstdc++-v3/ChangeLog:

	* src/c++23/print.cc (__open_terminal(FILE*)): Avoid fileno
	macro.
---
 libstdc++-v3/src/c++23/print.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/libstdc++-v3/src/c++23/print.cc b/libstdc++-v3/src/c++23/print.cc
index d72ab856017..be9762bbfdc 100644
--- a/libstdc++-v3/src/c++23/print.cc
+++ b/libstdc++-v3/src/c++23/print.cc
@@ -76,7 +76,7 @@  namespace
 	if (int fd = ::_fileno(f); fd >= 0)
 	  return check_for_console((void*)_get_osfhandle(fd));
 #elifdef _GLIBCXX_HAVE_UNISTD_H
-	if (int fd = ::fileno(f); fd >= 0 && ::isatty(fd))
+	if (int fd = (::fileno)(f); fd >= 0 && ::isatty(fd))
 	  return f;
 #endif
       }