mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 18:58:00 -06:00
Move confess_at() to utils.cpp
This commit is contained in:
parent
1b9d2e2ef8
commit
b6548137de
2 changed files with 29 additions and 34 deletions
26
xs/src/utils.cpp
Normal file
26
xs/src/utils.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include <myinit.h>
|
||||
|
||||
void
|
||||
confess_at(const char *file, int line, const char *func,
|
||||
const char *pat, ...)
|
||||
{
|
||||
va_list args;
|
||||
SV *error_sv = newSVpvf("Error in function %s at %s:%d: ", func,
|
||||
file, line);
|
||||
|
||||
va_start(args, pat);
|
||||
sv_vcatpvf(error_sv, pat, &args);
|
||||
va_end(args);
|
||||
|
||||
sv_catpvn(error_sv, "\n\t", 2);
|
||||
|
||||
dSP;
|
||||
ENTER;
|
||||
SAVETMPS;
|
||||
PUSHMARK(SP);
|
||||
XPUSHs( sv_2mortal(error_sv) );
|
||||
PUTBACK;
|
||||
call_pv("Carp::confess", G_DISCARD);
|
||||
FREETMPS;
|
||||
LEAVE;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue