[gcc r16-8189] libstdc++: Fix preprocessor condition for AIX

Jonathan Wakely redi@gcc.gnu.org
Fri Mar 20 12:10:58 GMT 2026


https://gcc.gnu.org/g:d2a883a0aee280a6f835eef7a1eda11a6798cc60

commit r16-8189-gd2a883a0aee280a6f835eef7a1eda11a6798cc60
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Mar 20 00:01:12 2026 +0000

    libstdc++: Fix preprocessor condition for AIX
    
    Only AIX uses getenv, so including <cstdlib> should be done when _AIX is
    defined, not when it's undefined.
    
    libstdc++-v3/ChangeLog:
    
            * src/c++20/tzdb.cc [_AIX]: Change #ifndef to #ifdef.

Diff:
---
 libstdc++-v3/src/c++20/tzdb.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/src/c++20/tzdb.cc b/libstdc++-v3/src/c++20/tzdb.cc
index e42ba70dee24..88096d0ae3b0 100644
--- a/libstdc++-v3/src/c++20/tzdb.cc
+++ b/libstdc++-v3/src/c++20/tzdb.cc
@@ -40,7 +40,7 @@
 #endif
 #include <filesystem> // filesystem::read_symlink
 
-#ifndef _AIX
+#ifdef _AIX
 # include <cstdlib>   // getenv
 #endif


More information about the Gcc-cvs mailing list