]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix bootstrap on AIX due to fileno macro
authorJonathan Wakely <jwakely@redhat.com>
Sat, 16 Dec 2023 23:51:09 +0000 (23:51 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 16 Dec 2023 23:52:30 +0000 (23:52 +0000)
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

index d72ab8560178215aaaec1c6096c18defa622c9da..be9762bbfdcc2ba30d3dad988b4a6c62bd02b3c7 100644 (file)
@@ -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
       }