After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743795 - gtask: add thread name support on OS X and iOS
gtask: add thread name support on OS X and iOS
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Mac OS
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-01 01:45 UTC by Ilya Konstantinov
Modified: 2015-02-01 21:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1.94 KB, application/octet-stream)
2015-02-01 01:45 UTC, Ilya Konstantinov
  Details
Patch (2.14 KB, patch)
2015-02-01 02:14 UTC, Ilya Konstantinov
committed Details | Review

Description Ilya Konstantinov 2015-02-01 01:45:40 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
Comment 1 Ilya Konstantinov 2015-02-01 02:14:04 UTC
Created attachment 295879 [details] [review]
Patch
Comment 3 Nicolas Dufresne (ndufresne) 2015-02-01 19:41:55 UTC
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
Comment 4 Ilya Konstantinov 2015-02-01 19:44:44 UTC
Oops, sorry for that :-)

Although _MSC_VER should be >0, so I don't see how that'll break.
Comment 5 Nicolas Dufresne (ndufresne) 2015-02-01 19:48:57 UTC
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.
Comment 6 Ilya Konstantinov 2015-02-01 19:55:18 UTC
#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.
Comment 7 Nicolas Dufresne (ndufresne) 2015-02-01 20:16:01 UTC
(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 ?
Comment 8 Ilya Konstantinov 2015-02-01 21:00:11 UTC
(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.
Comment 9 Nicolas Dufresne (ndufresne) 2015-02-01 21:43:06 UTC
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.