added prototype for basic oops handler function
This commit is contained in:
31
include/nickel/oops.h
Normal file
31
include/nickel/oops.h
Normal 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
|
||||
Reference in New Issue
Block a user