csources_v2/c_code/12_17/@m..@slib@sposix@sposix.nim.c
2022-12-16 10:54:01 +08:00

135 lines
4.1 KiB
C

/* Generated by Nim Compiler v1.9.0 */
#define NIM_INTBITS 64
#define NIM_EmulateOverflowChecks
#include "nimbase.h"
#include <sys/types.h>
#include <signal.h>
#undef LANGUAGE_C
#undef MIPSEB
#undef MIPSEL
#undef PPC
#undef R3000
#undef R4000
#undef i386
#undef linux
#undef mips
#undef near
#undef far
#undef powerpc
#undef unix
#define nimfr_(x, y)
#define nimln_(x, y)
typedef struct tyObject_OSError__PeQ9bR8XhClb9cp9cbW28aSyw tyObject_OSError__PeQ9bR8XhClb9cp9cbW28aSyw;
typedef struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA;
typedef struct Exception Exception;
typedef struct RootObj RootObj;
typedef struct TNimTypeV2 TNimTypeV2;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA tySequence__uB9b75OUPRENsBAu4AnoePA;
typedef struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content tySequence__uB9b75OUPRENsBAu4AnoePA_Content;
typedef struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA;
struct TNimTypeV2 {
void* destructor;
NI size;
NI16 align;
NI16 depth;
NU32* display;
void* traceImpl;
void* typeInfoV1;
NI flags;
};
struct RootObj {
TNimTypeV2* m_type;
};
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tySequence__uB9b75OUPRENsBAu4AnoePA {
NI len; tySequence__uB9b75OUPRENsBAu4AnoePA_Content* p;
};
struct Exception {
RootObj Sup;
Exception* parent;
NCSTRING name;
NimStringV2 message;
tySequence__uB9b75OUPRENsBAu4AnoePA trace;
Exception* up;
};
struct tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA {
Exception Sup;
};
struct tyObject_OSError__PeQ9bR8XhClb9cp9cbW28aSyw {
tyObject_CatchableError__qrLSDoe2oBoAqNtJ9badtnA Sup;
NI32 errorCode;
};
struct tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA {
NCSTRING procname;
NI line;
NCSTRING filename;
};
#ifndef tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
#define tySequence__uB9b75OUPRENsBAu4AnoePA_Content_PP
struct tySequence__uB9b75OUPRENsBAu4AnoePA_Content { NI cap; tyObject_StackTraceEntry__oLyohQ7O2XOvGnflOss8EA data[SEQ_DECL_SIZE];};
#endif
N_LIB_PRIVATE N_NIMCALL(void*, nimNewObj)(NI size, NI alignment);
N_LIB_PRIVATE N_NIMCALL(void, raiseExceptionEx)(Exception* e, NCSTRING ename, NCSTRING procname, NCSTRING filename, NI line);
extern TNimTypeV2 NTIv2__PeQ9bR8XhClb9cp9cbW28aSyw_;
static const struct {
NI cap; NIM_CHAR data[34+1];
} TM__mJPr4mHlDfNAl9asG6X7NFA_2 = { 34 | NIM_STRLIT_FLAG, "Nintendo switch cannot get si_pid!" };
static const NimStringV2 TM__mJPr4mHlDfNAl9asG6X7NFA_3 = {34, (NimStrPayload*)&TM__mJPr4mHlDfNAl9asG6X7NFA_2};
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, WIFSIGNALED__posixZposix_867)(int s) {
NIM_BOOL result;
NIM_BOOL T1_;
result = (NIM_BOOL)0;
T1_ = (NIM_BOOL)0;
T1_ = (((NI32)0) < (NI32)(s & ((NI32)127)));
if (!(T1_)) goto LA2_;
T1_ = ((NI32)(s & ((NI32)127)) < ((NI32)127));
LA2_: ;
result = T1_;
return result;
}
N_LIB_PRIVATE N_NIMCALL(int, WTERMSIG__posixZposix_861)(int s) {
int result;
result = (int)0;
result = (NI32)(s & ((NI32)127));
return result;
}
N_LIB_PRIVATE N_NIMCALL(int, WEXITSTATUS__posixZposix_851)(int s) {
int result;
result = (int)0;
result = (NI32)((NI32)((NI64)(s) >> (NU64)(((NI)8))) & ((NI32)255));
return result;
}
N_LIB_PRIVATE N_NIMCALL(pid_t, si_pid__posixZposix_220)(siginfo_t info) {
pid_t result;
tyObject_OSError__PeQ9bR8XhClb9cp9cbW28aSyw* T1_;
{ result = (pid_t)0;
T1_ = NIM_NIL;
T1_ = (tyObject_OSError__PeQ9bR8XhClb9cp9cbW28aSyw*) nimNewObj(sizeof(tyObject_OSError__PeQ9bR8XhClb9cp9cbW28aSyw), NIM_ALIGNOF(tyObject_OSError__PeQ9bR8XhClb9cp9cbW28aSyw));
(*T1_).Sup.Sup.Sup.m_type = (&NTIv2__PeQ9bR8XhClb9cp9cbW28aSyw_);
(*T1_).Sup.Sup.name = "OSError";
(*T1_).Sup.Sup.message = TM__mJPr4mHlDfNAl9asG6X7NFA_3;
(*T1_).Sup.Sup.parent = ((Exception*) NIM_NIL);
raiseExceptionEx((Exception*)T1_, "OSError", "si_pid", "posix_nintendoswitch.nim", 315);
goto BeforeRet_;
}BeforeRet_: ;
return result;
}
N_LIB_PRIVATE N_NIMCALL(NIM_BOOL, WIFEXITED__posixZposix_858)(int s) {
NIM_BOOL result;
result = (NIM_BOOL)0;
result = ((NI32)(s & ((NI32)255)) == ((NI32)0));
return result;
}