27#ifndef FNFT__ERRWARN_H
28#define FNFT__ERRWARN_H
36#define FNFT__WARN(msg) fnft__warn_aux(__func__, __LINE__, msg);
42#define FNFT__E_NOMEM FNFT__ERRMSG(FNFT_EC_NOMEM, "Out of memory.")
48#define FNFT__E_INVALID_ARGUMENT(name) FNFT__ERRMSG(FNFT_EC_INVALID_ARGUMENT, FNFT__E_INVALID_ARGUMENT_(name))
57#define FNFT__E_SUBROUTINE(ec) FNFT__ERRMSG(-abs(ec), "Subroutine failure.")
63#define FNFT__E_DIV_BY_ZERO FNFT__ERRMSG(FNFT_EC_DIV_BY_ZERO, "Division by zero.")
69#define FNFT__E_TEST_FAILED FNFT__ERRMSG(FNFT_EC_TEST_FAILED, "Test failed.")
75#define FNFT__E_OTHER(msg) FNFT__ERRMSG(FNFT_EC_OTHER, msg)
82#define FNFT__E_NOT_YET_IMPLEMENTED(name,msg) FNFT__ERRMSG(FNFT_EC_NOT_YET_IMPLEMENTED, FNFT__E_NOT_YET_IMPLEMENTED_(name,msg))
88#define FNFT__E_SANITY_CHECK_FAILED(msg) FNFT__ERRMSG(FNFT_EC_SANITY_CHECK_FAILED, FNFT__E_SANITY_CHECK_FAILED_(msg))
94#define FNFT__E_ASSERTION_FAILED FNFT__ERRMSG(FNFT_EC_ASSERTION_FAILED, "Assertion failed.")
101#define FNFT__CHECK_RETCODE(ret_code, label) {if (ret_code!=FNFT_SUCCESS) {ret_code=FNFT__E_SUBROUTINE(ret_code);goto label;}}
108#define FNFT__CHECK_NOMEM(var,ret_code,label) {if (var==NULL) {ret_code=FNFT__E_NOMEM;goto label;}}
110#ifdef FNFT_ENABLE_SHORT_NAMES
111#define WARN(msg) FNFT__WARN(msg)
112#define E_NOMEM FNFT__E_NOMEM
113#define E_INVALID_ARGUMENT(name) FNFT__E_INVALID_ARGUMENT(name)
114#define E_SUBROUTINE(ec) FNFT__E_SUBROUTINE(ec)
115#define E_DIV_BY_ZERO FNFT__E_DIV_BY_ZERO
116#define E_TEST_FAILED FNFT__E_TEST_FAILED
117#define E_OTHER(msg) FNFT__E_OTHER(msg)
118#define E_NOT_YET_IMPLEMENTED(name,msg) FNFT__E_NOT_YET_IMPLEMENTED(name,msg)
119#define E_SANITY_CHECK_FAILED(msg) FNFT__E_SANITY_CHECK_FAILED(msg)
120#define E_ASSERTION_FAILED FNFT__E_ASSERTION_FAILED
121#define CHECK_RETCODE(ret_code,label) FNFT__CHECK_RETCODE(ret_code,label)
122#define CHECK_NOMEM(var,ret_code,label) FNFT__CHECK_NOMEM(var,ret_code,label)
133#define FNFT__ERRMSG(ec,msg) fnft__errmsg_aux(ec, __func__, __LINE__, msg);
140#define FNFT__E_INVALID_ARGUMENT_(name) "Invalid argument "#name"."
147#define FNFT__E_NOT_YET_IMPLEMENTED_(name,msg) "Not yet implemented ("#name"). "#msg
154#define FNFT__E_SANITY_CHECK_FAILED_(msg) "Sanity check failed ("#msg")."
164 const FNFT_INT line,
const char *msg);
int32_t FNFT_INT
Definition fnft_numtypes.h:56
FNFT_INT fnft__errmsg_aux(const FNFT_INT ec, const char *func, const FNFT_INT line, const char *msg)
void fnft__warn_aux(const char *func, const FNFT_INT line, const char *msg)