mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-15 07:32:39 -07:00
Move confess_at() to utils.cpp
This commit is contained in:
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;
|
||||
}
|
||||
Reference in New Issue
Block a user