Re: [Mingw-w64-public] [PATCH] intrincs: check for __rdtsc

2017-05-21 Thread Martell Malone
ping :)

On Thu, May 11, 2017 at 2:10 PM, Martell Malone 
wrote:

> Thanks Kai,
>
> We probably don't need to push and pop because this is not a header to be
> installed
>
> Updated diff
>
> diff --git a/mingw-w64-crt/intrincs/rdtsc.c b/mingw-w64-crt/intrincs/
> rdtsc.c
> index fd9cb75d..bf9c03b3 100644
> --- a/mingw-w64-crt/intrincs/rdtsc.c
> +++ b/mingw-w64-crt/intrincs/rdtsc.c
> @@ -4,11 +4,14 @@
>   * No warranty is given; refer to the file DISCLAIMER.PD within this
> package.
>   */
> -#ifdef __clang__
> -#define __IA32INTRIN_H
> -#endif
>  #include 
> +/* Clang has support for MSVC builtins, GCC doesn't */
> +#ifndef __has_builtin
> +  #define __has_builtin(x) 0
> +#endif
> +
> +#if !__has_builtin(__rdtsc)
>  unsigned __int64 __rdtsc(void)
>  {
>  #ifdef _WIN64
> @@ -21,4 +24,4 @@ unsigned __int64 __rdtsc(void)
>: "=a" (val1), "=d" (val2));
>return ((unsigned __int64)val1) | (((unsigned __int64)val2) << 32);
>  }
> -
> +#endif
>
> On Thu, May 11, 2017 at 1:15 PM, Kai Tietz 
> wrote:
>
>> Hmm, where is the corresponding pop_macro pragma?
>>
>> Regards,
>> Kai
>>
>> 2017-05-11 14:09 GMT+02:00 Martell Malone :
>> >>
>> >> While it's not "good form" to have the prototype
>> >> in multiple places...
>> >
>> > Attached updated diff
>> >
>> > Please Review
>> >
>> > diff --git a/mingw-w64-crt/intrincs/rdtsc.c
>> b/mingw-w64-crt/intrincs/rdtsc.c
>> > index fd9cb75d..7c5adeb0 100644
>> > --- a/mingw-w64-crt/intrincs/rdtsc.c
>> > +++ b/mingw-w64-crt/intrincs/rdtsc.c
>> > @@ -4,11 +4,15 @@
>> >   * No warranty is given; refer to the file DISCLAIMER.PD within this
>> > package.
>> >   */
>> > -#ifdef __clang__
>> > -#define __IA32INTRIN_H
>> > -#endif
>> >  #include 
>> > +/* Clang has support for MSVC builtins, GCC doesn't */
>> > +#pragma push_macro("__has_builtin")
>> > +#ifndef __has_builtin
>> > +  #define __has_builtin(x) 0
>> > +#endif
>> > +
>> > +#if !__has_builtin(__rdtsc)
>> >  unsigned __int64 __rdtsc(void)
>> >  {
>> >  #ifdef _WIN64
>> > @@ -21,4 +25,4 @@ unsigned __int64 __rdtsc(void)
>> >: "=a" (val1), "=d" (val2));
>> >return ((unsigned __int64)val1) | (((unsigned __int64)val2) <<
>> 32);
>> >  }
>> > -
>> > +#endif
>> >
>> > On Sun, Apr 16, 2017 at 3:06 AM, David Wohlferd 
>> > wrote:
>> >
>> >> On 4/14/2017 7:14 AM, Martell Malone wrote:
>> >> > Updated clang no longer defines __IA32INTRIN_H so lets do this
>> properly.
>> >>
>> >> It appears that the only use for  in that file is the
>> >> prototype for __rdtsc.  While it's not "good form" to have the
>> prototype
>> >> in multiple places...
>> >>
>> >> > I assume intrin-impl.h is only ever included by intrin.h?
>> >>
>> >> Fraid not.
>> >>
>> >> mingw-w64-headers\include\winbase.h:#include 
>> >> mingw-w64-headers\include\winnt.h:#include 
>> >>
>> >> > If not I will have to find a way to deal with __has_builtin in both
>> files
>> >>
>> >>
>> >> 
>> >> --
>> >> 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
>>
>> 
>> --
>> 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] normalize strftime and strftime_l

2017-05-21 Thread Martell Malone
Context: libc++ uses strftime_l now

Please Review

Kind Regards
Martell

diff --git a/mingw-w64-crt/lib32/msvcrt.def.in b/mingw-w64-crt/lib32/
msvcrt.def.in
index 51f62cb6..f22a79a9 100644
--- a/mingw-w64-crt/lib32/msvcrt.def.in
+++ b/mingw-w64-crt/lib32/msvcrt.def.in
@@ -1210,6 +1210,8 @@ mbstowcs_s
 printf_s
 qsort_s
 scanf_s
+strftime
+_strftime_l
 ; sprintf_s replaced by emu
 sscanf_s
 strcat_s
diff --git a/mingw-w64-crt/lib64/msvcrt.def.in b/mingw-w64-crt/lib64/
msvcrt.def.in
index bcf41ac7..60ddae05 100644
--- a/mingw-w64-crt/lib64/msvcrt.def.in
+++ b/mingw-w64-crt/lib64/msvcrt.def.in
@@ -1199,6 +1199,7 @@ strcspn
 strerror
 ; strerror_s replaced by emu
 strftime
+_strftime_l
 strlen
 strncat
 strncat_s
diff --git a/mingw-w64-crt/libarm32/msvcrt.def
b/mingw-w64-crt/libarm32/msvcrt.def
index 2533d5ac..bf5b9e82 100644
--- a/mingw-w64-crt/libarm32/msvcrt.def
+++ b/mingw-w64-crt/libarm32/msvcrt.def
@@ -1189,6 +1189,7 @@ strcspn
 strerror
 strerror_s
 strftime
+strftime_l
 strlen
 strncat
 strncat_s
--
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