aboutsummaryrefslogblamecommitdiff
path: root/lib/die.c
blob: f58195132c47c1046c000acc3f429b292a0d5835 (plain) (tree)




















                                                                                  
// SPDX-License-Identifier: LGPL-3.0-or-later

#include "impl.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#undef hkvs_die
void hkvs_die(const char *msg) {
	hkvs_die_ext(NULL, NULL, 0, msg);
}

void hkvs_die_ext(const char *func, const char *file, int line, const char *msg) {
	(void)file;
	if(func) {
		fprintf(stderr, "Internal error: [%s:%d] %s\n", func, line, msg);
	} else {
		fprintf(stderr, "Internal error: %s\n", msg);
	}
	abort();
}