added prototype for basic oops handler function

This commit is contained in:
2026-01-15 12:51:08 -05:00
parent b0db2effc7
commit 507c274887

31
include/nickel/oops.h Normal file
View File

@@ -0,0 +1,31 @@
#ifndef __NICKEL_OOPS_H
#define __NICKEL_OOPS_H
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#ifdef __cplusplus
extern "C" {
#endif
// TODO: C23 adds [[noreturn]] (& [[]] function attribute tags)
// which are standardized, the below depends on compiler support.
#if defined(__GNUC__) || defined(__CLANG__)
#define NORETURN __attribute__ ((__noreturn__))
#else
#define NORETURN
#endif /* __GNUC__ || __CLANG__*/
void nickel_oops_handler(const char *format, ...) NORETURN;
#ifdef __cplusplus
}
#endif
// clean up our noreturn define
#undef NORETURN
#endif