libpulsar
A modular compiler for the pulsar programming language
Loading...
Searching...
No Matches
src
util
abort.c
Go to the documentation of this file.
1
// Copyright (C) 2023 Ethan Uppal. All rights reserved.
2
3
#include <stdlib.h>
// exit
4
#include <stdio.h>
// fprintf, stderr
5
#include "
abort.h
"
// STR
6
7
void
_ps_abort
(
STR
msg,
int
code,
STR
filename,
STR
function,
int
line) {
8
int
ret = fprintf(stderr,
"ps_abort(exit=%d): %s:%d:%s: %s\n"
, code,
9
filename, line, function, msg);
10
if
(ret < 0) {
11
perror(
"_ps_abort: fprintf"
);
12
}
13
exit(code);
14
}
_ps_abort
void _ps_abort(STR msg, int code, STR filename, STR function, int line)
Aborts the program with the given message.
Definition
abort.c:7
abort.h
Defines assertion and abortion functionality.
STR
#define STR
Definition
def.h:40
Generated by
1.9.8