Re: [Mingw-w64-public] [PATCH] versionhelpers.h: Added IsWindows10OrGreater implementation.
On 05/08/2017 07:54 PM, Jacek Caban wrote: > Signed-off-by: Jacek Caban> --- > mingw-w64-headers/include/versionhelpers.h | 8 > 1 file changed, 8 insertions(+) > > Looks good, please apply, thanks. signature.asc Description: OpenPGP digital signature -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH] versionhelpers.h: Added IsWindows10OrGreater implementation.
Signed-off-by: Jacek Caban--- mingw-w64-headers/include/versionhelpers.h | 8 1 file changed, 8 insertions(+) diff --git a/mingw-w64-headers/include/versionhelpers.h b/mingw-w64-headers/include/versionhelpers.h index 25ea414..178e788 100644 --- a/mingw-w64-headers/include/versionhelpers.h +++ b/mingw-w64-headers/include/versionhelpers.h @@ -70,6 +70,14 @@ VERSIONHELPERAPI IsWindows8Point1OrGreater(void) { return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0); } +VERSIONHELPERAPI IsWindowsThresholdOrGreater(void) { +return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), LOBYTE(_WIN32_WINNT_WINBLUE), 0); +} + +VERSIONHELPERAPI IsWindows10OrGreater(void) { +return IsWindowsThresholdOrGreater(); +} + VERSIONHELPERAPI IsWindowsServer(void) { OSVERSIONINFOEXW vi = {sizeof(vi),0,0,0,0,{0},0,0,0,VER_NT_WORKSTATION}; return !VerifyVersionInfoW(, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL)); -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] How to access _Decimal64 functions in math.h
-Original Message- From: JonY Sent: Monday, May 08, 2017 8:47 PM To: mingw-w64-public@lists.sourceforge.net Subject: Re: [Mingw-w64-public] How to access _Decimal64 functions in math.h [snip] >> >> All I get is: >> >> C:\Users\sisyphus\AppData\Local\Temp\cc2vb9go.o:d64.c:(.text+0x2e): >> undefined reference to `expd64' >> collect2.exe: error: ld returned 1 exit status >> >> What else is needed ? >> > > Unfortunately none of the math code is even implemented. > > The only part that somewhat works is the decimal float printf code, which > is buried under --enable-experimental in mingw-w64-crt. It isn't exactly > widely tested either. Oh I'll adjust my level of excitement accordingly ;-) Thanks for the quick response ! Cheers, Rob -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] How to access _Decimal64 functions in math.h
On 05/08/2017 09:59 AM, sisyph...@optusnet.com.au wrote: > Hi, > > math.h prototypes a number of _Decimal32, _Decimal64 and_Decimal128 > functions - eg: > > _Decimal64 __cdecl expd64(_Decimal64 _X); > > But when I try to compile (gcc -o d64.exe d64.c): > > /***/ > /* d64.c */ > #include > > int main(void) { > > _Decimal64 x = 2.3DD, ret; > > ret = expd64(x); > > return 0; > } > > /***/ > > All I get is: > > C:\Users\sisyphus\AppData\Local\Temp\cc2vb9go.o:d64.c:(.text+0x2e): > undefined reference to `expd64' > collect2.exe: error: ld returned 1 exit status > > What else is needed ? > Unfortunately none of the math code is even implemented. The only part that somewhat works is the decimal float printf code, which is buried under --enable-experimental in mingw-w64-crt. It isn't exactly widely tested either. signature.asc Description: OpenPGP digital signature -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
ok, please apply. Thanks, Kai 2017-05-08 12:19 GMT+02:00 Liu Hao: > On 2017/5/3 15:35, Christer Solskogen wrote: >> >> I'm having a hard time (cross) compiling winpthreads (from 5.x branch) >> with gcc 7.1. >> (... abridgement ...) >> src/.libs/libwinpthread_la-clock.o:clock.c:(.text+0x270): undefined >> reference to `__divmoddi4' > > Here is the 'real' fix for it. Please review. > > (I really hate this C-ish code but this way it looks like how `__udivdi3` > was implemented.) > > -- > Best regards, > LH_Mouse > > > > > From 04f0579cb7e2f294e1e3ad2be18b8d059546208f Mon Sep 17 00:00:00 2001 > From: Liu Hao > Date: Wed, 3 May 2017 15:52:32 +0800 > Subject: [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for > GCC > 7. > > GCC targeting i686 _may_ generate an external call to the function in > question when divding a 64-bit (DIMode) integer with another one. > Since we are linking against a fake libgcc, this function is not available. > > Signed-off-by: Liu Hao > --- > .../winpthreads/src/libgcc/dll_math.c | 27 > ++ > 1 file changed, 27 insertions(+) > > diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c > b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c > index e09b481b..aeec0680 100644 > --- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c > +++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c > @@ -120,6 +120,7 @@ u_quad_t__qdivrem(u_quad_t u, u_quad_t v, u_quad_t > *rem); > u_quad_t __udivdi3(u_quad_t a, u_quad_t b); > u_quad_t __umoddi3(u_quad_t a, u_quad_t b); > int__ucmpdi2(u_quad_t a, u_quad_t b); > +quad_t __divmoddi4(quad_t a, quad_t b, quad_t *rem); > > #endif /* !_LIBKERN_QUAD_H_ */ > > @@ -546,6 +547,32 @@ __umoddi3(a, b) > (void)__qdivrem(a, b, ); > return (r); > } > + > +/* > + * Divide two signed quads. > + * This function is new in GCC 7. > + */ > +quad_t > +__divmoddi4(a, b, rem) > + quad_t a, b, *rem; > +{ > + u_quad_t ua, ub, uq, ur; > + int negq, negr; > + > + if (a < 0) > + ua = -(u_quad_t)a, negq = 1, negr = 1; > + else > + ua = a, negq = 0, negr = 0; > + if (b < 0) > + ub = -(u_quad_t)b, negq ^= 1; > + else > + ub = b; > + uq = __qdivrem(ua, ub, ); > + if (rem) > + *rem = (negr ? -ur : ur); > + return (negq ? -uq : uq); > +} > + > #else > static int __attribute__((unused)) dummy; > #endif /*deined (_X86_) && !defined (__x86_64__)*/ > -- > 2.12.1 > > > -- > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > ___ > Mingw-w64-public mailing list > Mingw-w64-public@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7.
On 2017/5/3 15:35, Christer Solskogen wrote: I'm having a hard time (cross) compiling winpthreads (from 5.x branch) with gcc 7.1. (... abridgement ...) src/.libs/libwinpthread_la-clock.o:clock.c:(.text+0x270): undefined reference to `__divmoddi4' Here is the 'real' fix for it. Please review. (I really hate this C-ish code but this way it looks like how `__udivdi3` was implemented.) -- Best regards, LH_Mouse From 04f0579cb7e2f294e1e3ad2be18b8d059546208f Mon Sep 17 00:00:00 2001 From: Liu HaoDate: Wed, 3 May 2017 15:52:32 +0800 Subject: [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7. GCC targeting i686 _may_ generate an external call to the function in question when divding a 64-bit (DIMode) integer with another one. Since we are linking against a fake libgcc, this function is not available. Signed-off-by: Liu Hao --- .../winpthreads/src/libgcc/dll_math.c | 27 ++ 1 file changed, 27 insertions(+) diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c index e09b481b..aeec0680 100644 --- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c +++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c @@ -120,6 +120,7 @@ u_quad_t __qdivrem(u_quad_t u, u_quad_t v, u_quad_t *rem); u_quad_t __udivdi3(u_quad_t a, u_quad_t b); u_quad_t __umoddi3(u_quad_t a, u_quad_t b); int__ucmpdi2(u_quad_t a, u_quad_t b); +quad_t __divmoddi4(quad_t a, quad_t b, quad_t *rem); #endif /* !_LIBKERN_QUAD_H_ */ @@ -546,6 +547,32 @@ __umoddi3(a, b) (void)__qdivrem(a, b, ); return (r); } + +/* + * Divide two signed quads. + * This function is new in GCC 7. + */ +quad_t +__divmoddi4(a, b, rem) + quad_t a, b, *rem; +{ + u_quad_t ua, ub, uq, ur; + int negq, negr; + + if (a < 0) + ua = -(u_quad_t)a, negq = 1, negr = 1; + else + ua = a, negq = 0, negr = 0; + if (b < 0) + ub = -(u_quad_t)b, negq ^= 1; + else + ub = b; + uq = __qdivrem(ua, ub, ); + if (rem) + *rem = (negr ? -ur : ur); + return (negq ? -uq : uq); +} + #else static int __attribute__((unused)) dummy; #endif /*deined (_X86_) && !defined (__x86_64__)*/ -- 2.12.1 From 04f0579cb7e2f294e1e3ad2be18b8d059546208f Mon Sep 17 00:00:00 2001 From: Liu Hao Date: Wed, 3 May 2017 15:52:32 +0800 Subject: [PATCH] winpthreads/src/dll_math.c: Implement `__divmoddi4()' for GCC 7. GCC targeting i686 _may_ generate an external call to the function in question when divding a 64-bit (DIMode) integer with another one. Since we are linking against a fake libgcc, this function is not available. Signed-off-by: Liu Hao --- .../winpthreads/src/libgcc/dll_math.c | 27 ++ 1 file changed, 27 insertions(+) diff --git a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c index e09b481b..aeec0680 100644 --- a/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c +++ b/mingw-w64-libraries/winpthreads/src/libgcc/dll_math.c @@ -120,6 +120,7 @@ u_quad_t__qdivrem(u_quad_t u, u_quad_t v, u_quad_t *rem); u_quad_t __udivdi3(u_quad_t a, u_quad_t b); u_quad_t __umoddi3(u_quad_t a, u_quad_t b); int__ucmpdi2(u_quad_t a, u_quad_t b); +quad_t __divmoddi4(quad_t a, quad_t b, quad_t *rem); #endif /* !_LIBKERN_QUAD_H_ */ @@ -546,6 +547,32 @@ __umoddi3(a, b) (void)__qdivrem(a, b, ); return (r); } + +/* + * Divide two signed quads. + * This function is new in GCC 7. + */ +quad_t +__divmoddi4(a, b, rem) + quad_t a, b, *rem; +{ + u_quad_t ua, ub, uq, ur; + int negq, negr; + + if (a < 0) + ua = -(u_quad_t)a, negq = 1, negr = 1; + else + ua = a, negq = 0, negr = 0; + if (b < 0) + ub = -(u_quad_t)b, negq ^= 1; + else + ub = b; + uq = __qdivrem(ua, ub, ); + if (rem) + *rem = (negr ? -ur : ur); + return (negq ? -uq : uq); +} + #else static int __attribute__((unused)) dummy; #endif /*deined (_X86_) && !defined (__x86_64__)*/ -- 2.12.1 -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] How to access _Decimal64 functions in math.h
Hi, math.h prototypes a number of _Decimal32, _Decimal64 and_Decimal128 functions - eg: _Decimal64 __cdecl expd64(_Decimal64 _X); But when I try to compile (gcc -o d64.exe d64.c): /***/ /* d64.c */ #include int main(void) { _Decimal64 x = 2.3DD, ret; ret = expd64(x); return 0; } /***/ All I get is: C:\Users\sisyphus\AppData\Local\Temp\cc2vb9go.o:d64.c:(.text+0x2e): undefined reference to `expd64' collect2.exe: error: ld returned 1 exit status What else is needed ? Cheers, Rob -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public