headers: Don't use direct __p__environ() on arm64ec msvcrt.dll
The function __p__environ() only exists on x86 on msvcrt.dll;
prefer the _get_environ approach on arm64ec.
This provides a read-only rvalue from the _environ macro, like on
aarch64 on msvcrt.dll. (On other platforms, this macro expands
to (*__p__environ()), but for arm msvcrt.dll, it expands to
(__get_environ_ptr()).
It should be possible to provide the writable version of it like
on x86_64 as well, by compiling the misc/__p__environ.c helper
for arm64ec. (The "_environ" symbol, which the __p__environ
helper uses, is exported from the arm64ec msvcrt.dll and is available
in the import library) but as msvcrt.dll configurations on arm64ec is
an unimportant configuration overall, just pick the simplest solution.
Signed-off-by: Martin Storsjö <martin@martin.st>
1 file changed