GNOME Bugzilla – Bug 743795
gtask: add thread name support on OS X and iOS
Last modified: 2015-02-01 21:43:06 UTC
Created attachment 295878 [details] Patch The existing prctl interface is Linux-specific. Adding OS X / iOS specific code along with a configure.ac check. Pretty much derived from: https://bugzilla.gnome.org/show_bug.cgi?id=741807
Created attachment 295879 [details] [review] Patch
Patch was committed: http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=05296b35a526a425d24cd0ced8de8df9dc71243b
And I had to fix the build ;-P, thanks for that patch. commit 2b7a15172fdbe46d0cb3a58b0bf573b0ecb09771 Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> Date: Sun Feb 1 14:23:26 2015 -0500 build: Check that _MSC_VER macro is defined
Oops, sorry for that :-) Although _MSC_VER should be >0, so I don't see how that'll break.
It breaks on Linux since _MSC_VER is undefined, should I add a > check ? Other part of the code do checks like: #if defined (_MSC_VER) && _MSC_VER >= 1400 Version 1300, 1400 and 1600 are used, so I could not tell myself. Note that if it's >0 the right check, then it will most likely always work the way it is, and I'm not worried.
#if UNDEFINED_MACRO triggers an error? Anyway, #if defined (_MSC_VER) is detecting the wrong thing. It's detecting Microsoft C++ compiler. It usually corresponds to Win32 platform, but you obviously understand why it's the wrong define to look at. To be fully correct, change this to #if defined(_WIN32). Change the other #ifdef _MSC_VER in the file -- where SetThreadName is implemented -- to #if defined(_WIN32) as well.
(In reply to comment #6) > #if UNDEFINED_MACRO triggers an error? A warning, which is treated as error in git master. > > Anyway, #if defined (_MSC_VER) is detecting the wrong thing. It's detecting > Microsoft C++ compiler. It usually corresponds to Win32 platform, but you > obviously understand why it's the wrong define to look at. > > To be fully correct, change this to #if defined(_WIN32). Change the other > #ifdef _MSC_VER in the file -- where SetThreadName is implemented -- to #if > defined(_WIN32) as well. Would it be possible to provide a patch ?
(In reply to comment #7) > Would it be possible to provide a patch ? Yes, but I wouldn't want to do that without actually testing on Win32, so it'll take a bit.
Re-reading it, don't worry about it. Original code was: > -#ifdef _MSC_VER Which is replaced by > +#elif defined (_MSC_VER) So we are doing the same as before. If it turned to be wrong in some cases we'll fix it on time.