Skip to content

Commit

Permalink
Replace internal getEnvironPtr with its equivalent from druntime (#…
Browse files Browse the repository at this point in the history
…10614)

* Replace internal `getEnvironPtr` with its equivalent from druntime

* Further simplify
  • Loading branch information
0xEAB authored Jan 9, 2025
1 parent 955c6e3 commit 63fdb28
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions std/process.d
Original file line number Diff line number Diff line change
Expand Up @@ -146,23 +146,7 @@ private
// POSIX API declarations.
version (Posix)
{
version (Darwin)
{
extern(C) char*** _NSGetEnviron() nothrow;
const(char**) getEnvironPtr() @trusted
{
return *_NSGetEnviron;
}
}
else
{
// Made available by the C runtime:
extern(C) extern __gshared const char** environ;
const(char**) getEnvironPtr() @trusted
{
return environ;
}
}
import core.sys.posix.unistd : getEnvironPtr = environ;

@system unittest
{
Expand Down

0 comments on commit 63fdb28

Please sign in to comment.