From 2e53c0615989121af723e7439ac3b706e93b84f3 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 8 Nov 2016 10:59:43 +0100 Subject: [PATCH] Finished the SLIC3R_HAS_BROKEN_CROAK magic. --- xs/src/libslic3r/utils.cpp | 3 ++- xs/t/22_exception.t | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/xs/src/libslic3r/utils.cpp b/xs/src/libslic3r/utils.cpp index fa34be416..ebd2a97b4 100644 --- a/xs/src/libslic3r/utils.cpp +++ b/xs/src/libslic3r/utils.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #ifdef WIN32 #include @@ -23,7 +24,7 @@ void confess_at(const char *file, int line, const char *func, const char *format strcat(dest, "\r\n Closing the application.\r\n"); #ifdef WIN32 ::MessageBoxA(NULL, dest, "Slic3r Prusa Edition", MB_OK | MB_ICONERROR); - #endif; + #endif // Give up. printf(dest); diff --git a/xs/t/22_exception.t b/xs/t/22_exception.t index ca2ffea89..c7df42670 100644 --- a/xs/t/22_exception.t +++ b/xs/t/22_exception.t @@ -6,6 +6,11 @@ use warnings; use Slic3r::XS; use Test::More tests => 1; +if ($ENV{SLIC3R_HAS_BROKEN_CROAK}) +{ + ok 1, 'SLIC3R_HAS_BROKEN_CROAK set, croaks and confesses from a C++ code will lead to an application exit!'; +} +else { eval { Slic3r::xspp_test_croak_hangs_on_strawberry();