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ö <[email protected]> --- mingw-w64-headers/crt/stdlib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-headers/crt/stdlib.h b/mingw-w64-headers/crt/stdlib.h index 482971357..2a4359352 100644 --- a/mingw-w64-headers/crt/stdlib.h +++ b/mingw-w64-headers/crt/stdlib.h @@ -192,7 +192,7 @@ _CRTIMP int __cdecl ___mb_cur_max_func(void); #endif #ifndef _POSIX_ -#if (defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__)) && !defined(_UCRT) +#if (defined(_ARM_) || defined(__arm__) || defined(_ARM64_) || defined(__aarch64__) || defined(_ARM64EC_) || defined(__arm64ec__)) && !defined(_UCRT) /* The plain msvcrt.dll for arm/aarch64 lacks * _environ/_wenviron, but has these functions instead. */ _CRTIMP void __cdecl _get_environ(char ***); -- 2.43.0 _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
