[committed] libstdc++: Fix preprocessor condition for AIX

Jonathan Wakely jwakely@redhat.com
Fri Mar 20 12:11:23 GMT 2026


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.
---

Tested x86_64-linux and powerpc-aix.

Pushed to trunk.

 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
 
-- 
2.53.0



More information about the Libstdc++ mailing list