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 791922 - libdazzle: the Linux check in dzl_assert_is_main_thread is wrong
libdazzle: the Linux check in dzl_assert_is_main_thread is wrong
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other FreeBSD
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-24 14:21 UTC by Ting-Wei Lan
Modified: 2017-12-25 08:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
macros: do the Linux check correctly (962 bytes, patch)
2017-12-24 14:25 UTC, Ting-Wei Lan
none Details | Review
macros: do the Linux check correctly (1.26 KB, patch)
2017-12-25 08:10 UTC, Christian Hergert
committed Details | Review

Description Ting-Wei Lan 2017-12-24 14:21:56 UTC
I cannot find libdazzle on both bugzilla and gitlab, so I report it here under gnome-builder product.

In file src/util/dzl-macros.h, function dzl_assert_is_main_thread, it puts Linux-specific code in a '#ifndef __linux__' block, which is obviously wrong.
Comment 1 Ting-Wei Lan 2017-12-24 14:25:22 UTC
Created attachment 365935 [details] [review]
macros: do the Linux check correctly

It should be '#ifdef', not '#ifndef'. This commit also fixes a return
type error in the function.

This fixes compilation error on FreeBSD.

In file included from ../../source/libdazzle/tests/test-pattern-spec.c:19:
In file included from ../../source/libdazzle/src/dazzle.h:141:
../../source/libdazzle/src/util/dzl-macros.h:96:5: error: void function 'dzl_assert_is_main_thread' should not return a value [-Wreturn-type]
    return TRUE;
    ^      ~~~~
../../source/libdazzle/src/util/dzl-macros.h:99:23: error: use of undeclared identifier 'SYS_gettid'
  if ((pid_t)syscall (SYS_gettid) == getpid ())
                      ^
2 errors generated.
Comment 2 Christian Hergert 2017-12-25 08:10:18 UTC
Created attachment 365965 [details] [review]
macros: do the Linux check correctly

It should be '#ifdef', not '#ifndef'. This commit also fixes a return
type error in the function.
Comment 3 Christian Hergert 2017-12-25 08:10:52 UTC
Many thanks

Attachment 365965 [details] pushed as 3054025 - macros: do the Linux check correctly