From faf55c654097f3bc4eab65d7111d4f3a2dc88c7c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 27 May 2015 18:45:48 +0100 Subject: [PATCH] Only try to run xmessage on Linux --- src/assert.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/assert.cc b/src/assert.cc index 67dc6e07..3fa1b7e8 100644 --- a/src/assert.cc +++ b/src/assert.cc @@ -43,16 +43,12 @@ void on_assert_failed(const char* message) case IDOK: return; } -#else +#elif defined(__linux__) auto cmd = "xmessage -buttons 'quit:0,ignore:1' '" + msg + "'"; - switch (system(cmd.c_str())) - { - case -1: - case 0: - throw assert_failed(message); - case 1: - return; - } + if (system(cmd.c_str()) != 1) + throw assert_failed(msg); +#else + throw assert_failed(msg); #endif }