Skip to content

Commit 9cdbeb0

Browse files
authored
[core] fix getenv namespace error with libc++
Fixes #19850
1 parent 70e7395 commit 9cdbeb0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/foundation/src/FoundationUtils.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include <algorithm>
2424
#include <cassert>
25+
#include <cstdlib>
2526

2627
#include <errno.h>
2728
#include <string.h>
@@ -150,7 +151,7 @@ const std::string& GetFallbackRootSys() {
150151

151152
#ifdef ROOTPREFIX
152153
static bool IgnorePrefix() {
153-
static bool ignorePrefix = ::getenv("ROOTIGNOREPREFIX");
154+
static bool ignorePrefix = std::getenv("ROOTIGNOREPREFIX");
154155
return ignorePrefix;
155156
}
156157
#endif
@@ -164,7 +165,7 @@ const std::string& GetRootSys() {
164165
#endif
165166
static std::string rootsys;
166167
if (rootsys.empty()) {
167-
if (const char* envValue = ::getenv("ROOTSYS")) {
168+
if (const char* envValue = std::getenv("ROOTSYS")) {
168169
rootsys = envValue;
169170
// We cannot use gSystem->UnixPathName.
170171
ConvertToUnixPath(rootsys);

0 commit comments

Comments
 (0)