Re: [Mingw-w64-public] [PATCH] RFC: headers: Redirect _environ to the _get_environ function in msvcrt.dll for arm/arm64

2019-04-10 Thread Jacek Caban
On 4/10/19 11:15 PM, Martin Storsjö wrote: On Wed, 10 Apr 2019, Jacek Caban wrote: On 4/10/19 3:10 PM, Martin Storsjö wrote: The direct _environ pointer is not available in msvcrt.dll on arm/arm64. This provides a fallback read-only version of _environ, but code that tries to write it still

Re: [Mingw-w64-public] [PATCH 3/5] crt: arm: Use import libs for math functions

2019-04-10 Thread Jacek Caban
On 4/10/19 11:18 PM, Martin Storsjö wrote: On Wed, 10 Apr 2019, Jacek Caban wrote: On 4/10/19 3:11 PM, Martin Storsjö wrote: This avoids unnecessary precision loss e.g. in the log2 function, which previously was wrapped as log(x) / constant, which didn't return exact integers for powers of

Re: [Mingw-w64-public] [PATCH 3/5] crt: arm: Use import libs for math functions

2019-04-10 Thread Martin Storsjö
On Wed, 10 Apr 2019, Jacek Caban wrote: On 4/10/19 3:11 PM, Martin Storsjö wrote: This avoids unnecessary precision loss e.g. in the log2 function, which previously was wrapped as log(x) / constant, which didn't return exact integers for powers of two. Some math functions are kept for msvcrt,

Re: [Mingw-w64-public] [PATCH] RFC: headers: Redirect _environ to the _get_environ function in msvcrt.dll for arm/arm64

2019-04-10 Thread Martin Storsjö
On Wed, 10 Apr 2019, Jacek Caban wrote: On 4/10/19 3:10 PM, Martin Storsjö wrote: The direct _environ pointer is not available in msvcrt.dll on arm/arm64. This provides a fallback read-only version of _environ, but code that tries to write it still fails to compile though. This header is

Re: [Mingw-w64-public] [PATCH] RFC: headers: Redirect _environ to the _get_environ function in msvcrt.dll for arm/arm64

2019-04-10 Thread Jacek Caban
On 4/10/19 3:10 PM, Martin Storsjö wrote: The direct _environ pointer is not available in msvcrt.dll on arm/arm64. This provides a fallback read-only version of _environ, but code that tries to write it still fails to compile though. This header is getting messy. How about using UCRT path of

Re: [Mingw-w64-public] [PATCH 3/3] RFC: headers: Don't declare getpid for msvcrt versions where it's missing

2019-04-10 Thread Jacek Caban
On 4/10/19 3:09 PM, Martin Storsjö wrote: If the getpid function is missing, user code might try to reimplement it, with minor mismatches to the signature. Signed-off-by: Martin Storsjö That looks reasonable to me. Jacek ___ Mingw-w64-public

[Mingw-w64-public] [PATCH 5/5] crt: arm: Add implementations of remainder and remquo for msvcrt

2019-04-10 Thread Martin Storsjö
--- mingw-w64-crt/Makefile.am | 12 + mingw-w64-crt/math/arm-common/remainder.c | 14 ++ mingw-w64-crt/math/arm-common/remainderf.c | 14 ++ mingw-w64-crt/math/arm-common/remainderl.c | 17 mingw-w64-crt/math/arm-common/remquo.c | 31

[Mingw-w64-public] [PATCH 2/5] crt: arm: Add forwarding functions for scalbln similar to scalbn

2019-04-10 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- mingw-w64-crt/math/arm-common/scalbn.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/mingw-w64-crt/math/arm-common/scalbn.c b/mingw-w64-crt/math/arm-common/scalbn.c index 8f52c04be..0e2f14ab7 100644 ---

[Mingw-w64-public] [PATCH 3/3] RFC: headers: Don't declare getpid for msvcrt versions where it's missing

2019-04-10 Thread Martin Storsjö
If the getpid function is missing, user code might try to reimplement it, with minor mismatches to the signature. Signed-off-by: Martin Storsjö --- Suggestions on better ways of handling it are welcome. Within vlc, if the getpid function is missing, vlc provides its own compat wrapper. This is

[Mingw-w64-public] [PATCH 4/5] crt: arm: Provide fmodl as an alias for fmod

2019-04-10 Thread Martin Storsjö
On ARM, long double is the same as plain double, so we can provide this via an alias, instead of needing a full forwarder function. Signed-off-by: Martin Storsjö --- mingw-w64-crt/lib-common/api-ms-win-crt-math-l1-1-0.def.in | 1 + mingw-w64-crt/lib-common/msvcrt.def.in | 1

[Mingw-w64-public] [PATCH 1/3] crt: Skip x86-only symbols from libmsvcrt-os.a for arm

2019-04-10 Thread Martin Storsjö
These were optimistically kept for all architectures, when the arm32 and x64 versions of msvcrt.def.in were merged in 2146d75d7fd027118fe267f2a8fb139bcab6a9b8. In practice, these functions don't exist in modern msvcrt.dll on Windows 10 on ARM. Signed-off-by: Martin Storsjö ---

[Mingw-w64-public] [PATCH 1/5] crt: arm: Deduplicate C based arm/arm64 math implementations

2019-04-10 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- mingw-w64-crt/Makefile.am | 12 ++-- .../math/{arm => arm-common}/copysignl.c | 0 .../math/{arm => arm-common}/ldexpl.c | 2 +- .../math/{arm64 => arm-common}/log2.c | 2 +- .../math/{arm64 => arm-common}/scalbn.c

[Mingw-w64-public] [PATCH 3/5] crt: arm: Use import libs for math functions

2019-04-10 Thread Martin Storsjö
This avoids unnecessary precision loss e.g. in the log2 function, which previously was wrapped as log(x) / constant, which didn't return exact integers for powers of two. Some math functions are kept for msvcrt, while they are superfluous for ucrt where all those functions exist already (in C99

[Mingw-w64-public] [PATCH 2/3] crt: Don't provide the getpid == _getpid alias for arm

2019-04-10 Thread Martin Storsjö
There's no _getpid function on arm. Signed-off-by: Martin Storsjö --- mingw-w64-crt/def-include/msvcrt-common.def.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mingw-w64-crt/def-include/msvcrt-common.def.in b/mingw-w64-crt/def-include/msvcrt-common.def.in index

[Mingw-w64-public] [PATCH] RFC: headers: Redirect _environ to the _get_environ function in msvcrt.dll for arm/arm64

2019-04-10 Thread Martin Storsjö
The direct _environ pointer is not available in msvcrt.dll on arm/arm64. This provides a fallback read-only version of _environ, but code that tries to write it still fails to compile though. Signed-off-by: Martin Storsjö --- mingw-w64-headers/crt/stdlib.h | 26 ++ 1

[Mingw-w64-public] [PATCH 4/5] fileapi: Fix availability checks

2019-04-10 Thread Hugo Beauzée-Luyssen
WINSTORECOMPAT is used when we provide a replacement through winstorecompat, while these functions are not in libwinstorecompat, and are available when targetting UWP --- mingw-w64-headers/include/fileapi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[Mingw-w64-public] [PATCH 5/5] lib-common: Add missing functions to api-ms-core-file-l1-2-1

2019-04-10 Thread Hugo Beauzée-Luyssen
--- .../lib-common/api-ms-win-core-file-l1-2-1.def | 12 1 file changed, 12 insertions(+) diff --git a/mingw-w64-crt/lib-common/api-ms-win-core-file-l1-2-1.def b/mingw-w64-crt/lib-common/api-ms-win-core-file-l1-2-1.def index d3e0..2f02f903 100644 ---

[Mingw-w64-public] [PATCH 3/5] fileapi: Use the correct macro for desktop + app

2019-04-10 Thread Hugo Beauzée-Luyssen
These declarations were only available on desktop because we default WINAPI_FAMILY to WINAPI_FAMILY_DESKTOP_APP, causing APP specific declarations to be included. Building with an explicit WINAPI_FAMILY_DESKTOP would have cause these declarations to be missing ---

[Mingw-w64-public] [PATCH 1/5] Add missing api-ms-win-core-file-l1-2-2

2019-04-10 Thread Hugo Beauzée-Luyssen
--- mingw-w64-crt/Makefile.am| 2 ++ mingw-w64-crt/lib-common/api-ms-win-core-file-l1-2-1.def | 1 - mingw-w64-crt/lib-common/api-ms-win-core-file-l1-2-2.def | 8 mingw-w64-crt/lib-common/mincore.mri | 2 +-

[Mingw-w64-public] [PATCH 2/5] Move some functions declaration to fileapi.h

2019-04-10 Thread Hugo Beauzée-Luyssen
Where they belong, according to MSDN documentation --- mingw-w64-headers/include/fileapi.h | 13 +++-- mingw-w64-headers/include/winbase.h | 4 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/mingw-w64-headers/include/fileapi.h b/mingw-w64-headers/include/fileapi.h

[Mingw-w64-public] [PATCH] Add missing IO function

2019-04-10 Thread Hugo Beauzée-Luyssen
Some of the api-ms-win-core-io-l1-1-1.dll functions were not available on x86_64 & aarch64 builds. Add DeviceIoControl function through api-ms-win-core-io-l1-1-0.dll And udpate the headers accordingly --- mingw-w64-crt/Makefile.am | 1 +