From 63fdb282f17994b8a9db87f17e6a79892d506b07 Mon Sep 17 00:00:00 2001 From: Elias Batek Date: Thu, 9 Jan 2025 08:57:35 +0100 Subject: [PATCH] Replace internal `getEnvironPtr` with its equivalent from druntime (#10614) * Replace internal `getEnvironPtr` with its equivalent from druntime * Further simplify --- std/process.d | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/std/process.d b/std/process.d index 1cb2264f6d3..7faf8498343 100644 --- a/std/process.d +++ b/std/process.d @@ -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 {