[Spice-devel] [spice-common v2 1/3] log: Remove SPICE_DISABLE_ABORT
Eduardo Lima (Etrunko)
etrunko at redhat.com
Fri Jul 6 13:41:50 UTC 2018
On 06/07/18 03:20, Frediano Ziglio wrote:
>>
>> ACK series
>>
>
> For some reasons Meson build is failing, see
> https://gitlab.freedesktop.org/spice/spice-common/-/jobs/8351.
>
> I checked common/.deps/pixman_utils.Plo (autotool file dependencies)
> and there are GLib headers (don't ask me where they came from)
>
Yes, build fails here too (Fedora 27), and I wonder if the definition is
different in newer glib (Fedora 28):
/* Crashes the program. */
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_50
#ifndef G_OS_WIN32
# define g_abort() abort ()
#else
GLIB_AVAILABLE_IN_2_50
void g_abort (void) G_GNUC_NORETURN G_ANALYZER_NORETURN;
#endif
#endif
> Frediano
>
>> On Tue, 2018-07-03 at 12:42 +0200, Christophe Fergeau wrote:
>>> spice-gtk was the last user, and stopped using it on Jun 14th 2017
>>> in 040090ccba34 "build-sys: remove -DSPICE_DISABLE_ABORT"
>>>
>>> Signed-off-by: Christophe Fergeau <cfergeau at redhat.com>
>>> ---
>>> common/log.c | 4 ----
>>> common/spice_common.h | 4 ----
>>> tests/test-logging.c | 14 ++------------
>>> 3 files changed, 2 insertions(+), 20 deletions(-)
>>>
>>> diff --git a/common/log.c b/common/log.c
>>> index 7e460f0..b59c8a8 100644
>>> --- a/common/log.c
>>> +++ b/common/log.c
>>> @@ -34,12 +34,8 @@ static int glib_debug_level = INT_MAX;
>>> static int abort_mask = 0;
>>>
>>> #ifndef SPICE_ABORT_MASK_DEFAULT
>>> -#ifdef SPICE_DISABLE_ABORT
>>> -#define SPICE_ABORT_MASK_DEFAULT 0
>>> -#else
>>> #define SPICE_ABORT_MASK_DEFAULT
>>> (G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_ERROR)
>>> #endif
>>> -#endif
>>>
>>> #define G_LOG_DOMAIN "Spice"
>>>
>>> diff --git a/common/spice_common.h b/common/spice_common.h
>>> index 5572326..f9a7b3b 100644
>>> --- a/common/spice_common.h
>>> +++ b/common/spice_common.h
>>> @@ -28,10 +28,6 @@
>>> #include "backtrace.h"
>>> #include "log.h"
>>>
>>> -#ifdef SPICE_DISABLE_ABORT
>>> -#define spice_abort() do { } while(0)
>>> -#else
>>> #define spice_abort() abort()
>>> -#endif
>>>
>>> #endif
>>> diff --git a/tests/test-logging.c b/tests/test-logging.c
>>> index 437e0a1..559d656 100644
>>> --- a/tests/test-logging.c
>>> +++ b/tests/test-logging.c
>>> @@ -89,8 +89,7 @@ static void test_spice_fatal_warning(void)
>>> g_unsetenv("G_DEBUG");
>>> }
>>>
>>> -/* Checks that spice_critical() aborts by default if
>>> SPICE_DISABLE_ABORT is not
>>> - * defined at compile-time */
>>> +/* Checks that spice_critical() aborts by default */
>>> static void test_spice_fatal_critical(void)
>>> {
>>> if (g_test_subprocess()) {
>>> @@ -98,11 +97,7 @@ static void test_spice_fatal_critical(void)
>>> return;
>>> }
>>> g_test_trap_subprocess(NULL, 0, 0);
>>> -#ifdef SPICE_DISABLE_ABORT
>>> - g_test_trap_assert_passed();
>>> -#else
>>> g_test_trap_assert_failed();
>>> -#endif
>>> g_test_trap_assert_stderr("*spice_critical*");
>>> }
>>>
>>> @@ -132,8 +127,7 @@ static void test_spice_fatal_g_critical(void)
>>> g_unsetenv("G_DEBUG");
>>> }
>>>
>>> -/* Checks that spice_return_if_fail() aborts by default unless
>>> - * SPICE_DISABLE_ABORT was defined at compile time*/
>>> +/* Checks that spice_return_if_fail() aborts by default */
>>> static void test_spice_fatal_return_if_fail(void)
>>> {
>>> if (g_test_subprocess()) {
>>> @@ -141,11 +135,7 @@ static void
>>> test_spice_fatal_return_if_fail(void)
>>> return;
>>> }
>>> g_test_trap_subprocess(NULL, 0, 0);
>>> -#ifdef SPICE_DISABLE_ABORT
>>> - g_test_trap_assert_passed();
>>> -#else
>>> g_test_trap_assert_failed();
>>> -#endif
>>> g_test_trap_assert_stderr("*test_spice_fatal_return_if_fail*");
>>> }
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
>
--
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com
More information about the Spice-devel
mailing list