GNOME Bugzilla – Bug 791922
libdazzle: the Linux check in dzl_assert_is_main_thread is wrong
Last modified: 2017-12-25 08:10: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.
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.
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.
Many thanks Attachment 365965 [details] pushed as 3054025 - macros: do the Linux check correctly