Re: [Mingw-w64-public] [PATCH] versionhelpers.h: Fix IsWindowsThresholdOrGreater typo

2018-02-23 Thread Martin Storsjö

On Thu, 22 Feb 2018, James Ross-Gowan wrote:


Probably a copy/paste error. Without this, IsWindowsThresholdOrGreater
and IsWindows10OrGreater would always return FALSE, since they were
checking for Windows version 10.3.

Signed-off-by: James Ross-Gowan 
---
mingw-w64-headers/include/versionhelpers.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mingw-w64-headers/include/versionhelpers.h 
b/mingw-w64-headers/include/versionhelpers.h
index 178e7885..35e4d917 100644
--- a/mingw-w64-headers/include/versionhelpers.h
+++ b/mingw-w64-headers/include/versionhelpers.h
@@ -71,7 +71,7 @@ VERSIONHELPERAPI IsWindows8Point1OrGreater(void) {
}

VERSIONHELPERAPI IsWindowsThresholdOrGreater(void) {
-return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), 
LOBYTE(_WIN32_WINNT_WINBLUE), 0);
+return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINTHRESHOLD), 
LOBYTE(_WIN32_WINNT_WINTHRESHOLD), 0);
}

VERSIONHELPERAPI IsWindows10OrGreater(void) {
--
2.16.1


Thanks, pushed.

// Martin

--
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] headers: Temporarily undefine _Bool when typedeffing std::_Bool

2018-02-23 Thread Martin Storsjö

On Fri, 23 Feb 2018, Kai Tietz via Mingw-w64-public wrote:


Ok, thanks.


Thanks, pushed both.

// Martin

--
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] headers: Temporarily undefine _Bool when typedeffing std::_Bool

2018-02-23 Thread Kai Tietz via Mingw-w64-public
Ok, thanks.

Cheers,
Kai

2018-02-23 11:02 GMT+01:00 Martin Storsjö :
> This fixes building the following with libc++:
>
> #include 
> #include 
>
> With libc++, yvals.h is implicitly included by anything that includes
> locales (via xlocinfo.h).
>
> Signed-off-by: Martin Storsjö 
> ---
>  mingw-w64-headers/crt/yvals.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/mingw-w64-headers/crt/yvals.h b/mingw-w64-headers/crt/yvals.h
> index 70593c4..15130e4 100644
> --- a/mingw-w64-headers/crt/yvals.h
> +++ b/mingw-w64-headers/crt/yvals.h
> @@ -163,9 +163,12 @@
>  #define _Restrict __restrict__
>
>  #ifdef __cplusplus
> +#pragma push_macro("_Bool")
> +#undef _Bool
>  _STD_BEGIN
>  typedef bool _Bool;
>  _STD_END
> +#pragma pop_macro("_Bool")
>  #endif
>
>  #define _LONGLONG /* __MINGW_EXTENSION */ __int64
> --
> 2.7.4
>
>
> --
> 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] headers: Temporarily undefine _Bool when typedeffing std::_Bool

2018-02-23 Thread Martin Storsjö
This fixes building the following with libc++:

#include 
#include 

With libc++, yvals.h is implicitly included by anything that includes
locales (via xlocinfo.h).

Signed-off-by: Martin Storsjö 
---
 mingw-w64-headers/crt/yvals.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mingw-w64-headers/crt/yvals.h b/mingw-w64-headers/crt/yvals.h
index 70593c4..15130e4 100644
--- a/mingw-w64-headers/crt/yvals.h
+++ b/mingw-w64-headers/crt/yvals.h
@@ -163,9 +163,12 @@
 #define _Restrict __restrict__
 
 #ifdef __cplusplus
+#pragma push_macro("_Bool")
+#undef _Bool
 _STD_BEGIN
 typedef bool _Bool;
 _STD_END
+#pragma pop_macro("_Bool")
 #endif
 
 #define _LONGLONG /* __MINGW_EXTENSION */ __int64
-- 
2.7.4


--
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] crt: Allow sleeping for over a second with usleep

2018-02-23 Thread Kai Tietz via Mingw-w64-public
2018-02-23 10:56 GMT+01:00 Martin Storsjö :
> On Fri, 23 Feb 2018, Kai Tietz via Mingw-w64-public wrote:
>
>> Patch looks fine beside one nit.  The behavior above 4294967 seconds
>> seems to be pretty unexpected, isn't it?
>
>
> Well since the useconds_t parameter is a typedef for unsigned int, I
> wouldn't think that callers expect to be able to sleep that long anyway. So
> all possible input values (the values between 0 and UINT32_MAX) should work
> just fine when divided by 1000 and passed to Sleep, no?
>
> // Martin

True, as long as useconds_t is 32 bits wide

So patch is ok.
Thanks,
Kai

--
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] yvals.h: Don't create a _Bool typedef if a macro already exists

2018-02-23 Thread Martin Storsjö

On Fri, 23 Feb 2018, Kai Tietz via Mingw-w64-public wrote:


hmm, ok. But it might be better to temporary undefine _Bool via
'push_macro/pop_macro' pragma?


Thanks - that sounds like an even better fix, will post an updated patch.

// Martin

--
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] crt: Allow sleeping for over a second with usleep

2018-02-23 Thread Martin Storsjö

On Fri, 23 Feb 2018, Kai Tietz via Mingw-w64-public wrote:


Patch looks fine beside one nit.  The behavior above 4294967 seconds
seems to be pretty unexpected, isn't it?


Well since the useconds_t parameter is a typedef for unsigned int, I 
wouldn't think that callers expect to be able to sleep that long anyway. 
So all possible input values (the values between 0 and UINT32_MAX) should 
work just fine when divided by 1000 and passed to Sleep, no?


// Martin

--
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] crt: Allow sleeping for over a second with usleep

2018-02-23 Thread Kai Tietz via Mingw-w64-public
Patch looks fine beside one nit.  The behavior above 4294967 seconds
seems to be pretty unexpected, isn't it?

Cheers,
Kai

2018-02-22 22:17 GMT+01:00 Martin Storsjö :
> Even though the POSIX spec of usleep says that the argument shall
> be less than one million. Most unixes allow it and sleeps for over a
> second if requested (in practice, at least on Linux/glibc and macOS).
>
> Prefer matching other actual implementations (which ignore this
> aspect of the POSIX spec) instead of following the spec strictly.
>
> Signed-off-by: Martin Storsjö 
> ---
>  mingw-w64-crt/misc/mingw_usleep.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mingw-w64-crt/misc/mingw_usleep.c 
> b/mingw-w64-crt/misc/mingw_usleep.c
> index 2b2dc32..8246e0b 100644
> --- a/mingw-w64-crt/misc/mingw_usleep.c
> +++ b/mingw-w64-crt/misc/mingw_usleep.c
> @@ -10,9 +10,7 @@ int __cdecl usleep (useconds_t);
>  int __cdecl
>  usleep (useconds_t us)
>  {
> -  if (us >= 100)
> -return EINVAL;
> -  else if (us != 0)
> +  if (us != 0)
>  Sleep (us / 1000);
>
>return 0;
> --
> 2.7.4
>
>
> --
> 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


Re: [Mingw-w64-public] [PATCH] yvals.h: Don't create a _Bool typedef if a macro already exists

2018-02-23 Thread Kai Tietz via Mingw-w64-public
hmm, ok. But it might be better to temporary undefine _Bool via
'push_macro/pop_macro' pragma?

Kai

2018-02-23 10:20 GMT+01:00 Martin Storsjö :
> From: Hugo Beauzée-Luyssen 
>
> This fixes building the following with libc++:
>
> #include 
> #include 
>
> With libc++, yvals.h is implicitly included by anything that includes
> locales (via xlocinfo.h).
>
> Signed-off-by: Martin Storsjö 
> ---
>  mingw-w64-headers/crt/yvals.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/mingw-w64-headers/crt/yvals.h b/mingw-w64-headers/crt/yvals.h
> index 70593c4..98b6921 100644
> --- a/mingw-w64-headers/crt/yvals.h
> +++ b/mingw-w64-headers/crt/yvals.h
> @@ -163,10 +163,12 @@
>  #define _Restrict __restrict__
>
>  #ifdef __cplusplus
> +#ifndef _Bool
>  _STD_BEGIN
>  typedef bool _Bool;
>  _STD_END
>  #endif
> +#endif
>
>  #define _LONGLONG /* __MINGW_EXTENSION */ __int64
>  #define _ULONGLONG /* __MINGW_EXTENSION */ unsigned __int64
> --
> 2.7.4
>
>
> --
> 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] yvals.h: Don't create a _Bool typedef if a macro already exists

2018-02-23 Thread Martin Storsjö
From: Hugo Beauzée-Luyssen 

This fixes building the following with libc++:

#include 
#include 

With libc++, yvals.h is implicitly included by anything that includes
locales (via xlocinfo.h).

Signed-off-by: Martin Storsjö 
---
 mingw-w64-headers/crt/yvals.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mingw-w64-headers/crt/yvals.h b/mingw-w64-headers/crt/yvals.h
index 70593c4..98b6921 100644
--- a/mingw-w64-headers/crt/yvals.h
+++ b/mingw-w64-headers/crt/yvals.h
@@ -163,10 +163,12 @@
 #define _Restrict __restrict__
 
 #ifdef __cplusplus
+#ifndef _Bool
 _STD_BEGIN
 typedef bool _Bool;
 _STD_END
 #endif
+#endif
 
 #define _LONGLONG /* __MINGW_EXTENSION */ __int64
 #define _ULONGLONG /* __MINGW_EXTENSION */ unsigned __int64
-- 
2.7.4


--
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