Web lists-archives.com

Re: [Mingw-users] GCC-4.9.3 is now our current release




Final patch :) everything works now.

diff -urN gcc-5.3.0.old/libgcc/gthr-posix.h gcc-5.3.0/libgcc/gthr-posix.h
--- gcc-5.3.0.old/libgcc/gthr-posix.h    2015-01-05 13:33:28.000000000 +0100
+++ gcc-5.3.0/libgcc/gthr-posix.h    2016-03-17 06:28:09.201699900 +0100
@@ -371,7 +371,11 @@

    if (!(__gthrw_(pthread_create) (&new_thread_handle, 
&_objc_thread_attribs,
                    (void *) func, arg)))
+#ifdef PTW32_VERSION
+    thread_id = (objc_thread_t) new_thread_handle.p;
+#else
      thread_id = (objc_thread_t) new_thread_handle;
+#endif
    else
      thread_id = NULL;

@@ -468,7 +472,11 @@
  __gthread_objc_thread_id (void)
  {
    if (__gthread_active_p ())
+#ifdef PTW32_VERSION
+    return (objc_thread_t) __gthrw_(pthread_self) ().p;
+#else
      return (objc_thread_t) __gthrw_(pthread_self) ();
+#endif
    else
      return (objc_thread_t) 1;
  }
@@ -683,7 +691,11 @@
  static inline __gthread_t
  __gthread_self (void)
  {
+#ifdef PTW32_VERSION
+  return __gthrw_(pthread_self) ().p;
+#else
    return __gthrw_(pthread_self) ();
+#endif
  }

  static inline int
diff -urN gcc-5.3.0.old/libstdc++-v3/include/std/thread 
gcc-5.3.0/libstdc++-v3/include/std/thread
--- gcc-5.3.0.old/libstdc++-v3/include/std/thread    2015-03-26 
20:59:08.000000000 +0100
+++ gcc-5.3.0/libstdc++-v3/include/std/thread    2016-03-17 
06:32:41.124378000 +0100
@@ -83,10 +83,19 @@
        operator==(thread::id __x, thread::id __y) noexcept
        { return __gthread_equal(__x._M_thread, __y._M_thread); }

+      // implement operator< explicitly in terms of the internals of
+      // pthreads-win32's ptw32_handle_t so that std::thread can use 
pthreads
+#ifdef PTW32_VERSION
+      friend bool
+      operator<(thread::id __x, thread::id __y)
+      { return ( (__x._M_thread.p < __y._M_thread.p) ||
+      ((__x._M_thread.p == __y._M_thread.p) && (__x._M_thread.x < 
__y._M_thread.x) ) ); }
+#else
        friend bool
        operator<(thread::id __x, thread::id __y) noexcept
-      { return __x._M_thread < __y._M_thread; }
-
+      {    return __less<native_handle_type>::_S_less(__x._M_thread, 
__y._M_thread); }
+#endif
+
        template<class _CharT, class _Traits>
      friend basic_ostream<_CharT, _Traits>&
      operator<<(basic_ostream<_CharT, _Traits>& __out, thread::id __id);

Thanks for the assistance, im not all to well versed in C++ syntax so 
that one would have taken me a while.

Cheers ill start gathering up the patches and ship them to Keith, i 
guess he will be majorly pleased ;)

Den 17-03-2016 kl. 03:51 skrev K. Frank:
> Hi Ralph!
>
> A couple of comments, below.
>
> On Wed, Mar 16, 2016 at 10:14 PM, ralph engels <ralphengels@xxxxxxxxx> wrote:
>> Damn it runs right to the end and then fails on objc here
>>
>> thread_id = (objc_thread_t) new_thread_handle; cannot convert to a
>> referral type
>>
>> with an error about it not being able to convert it.
>>
>> objc_thread_t thread_id; = scalar
>> pthread_t new_thread_handle; =  struct
> "objc" sounds suspiciously like objective-c to me.  I happily made no
> attempt to support objective-c.  (My goal was to get g++ working with
> std::thread.)  However, I don't recall doing anything to turn objective-c
> off.
>
>> this is from gthr-default.h
> My recollection is that gthr-default.h mapped somehow to (maybe it was
> simply a copy of) either gthr-posix.h or gthr-win32.h.  My experiments
> getting std::thread to work via pthreads-win32 were based on tweaking
> gthr-posix.h.
>
>> guess its back to the drawing board.
> Maybe see whether your gthr-default.h is (more like) gthr-posix.h or
> gthr-win32.h (although I'm not sure what that would tell you).
>
> Also, if you don't need to support objective-c, maybe there's some macro
> define that turns objective-c threading on or off.  If so, maybe you could
> just disable objective-c and your problem might go away.  (Just guessing.)
>
> Again, I'd be curious to know what your specific goal is.
>
>
> Happy C++ Hacking!
>
>
> K. Frank
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
> _______________________________________________
> MinGW-users mailing list
> MinGW-users@xxxxxxxxxxxxxxxxxxxxx
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users
> Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe