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();