first
This commit is contained in:
commit
db1adbb838
35 changed files with 4408 additions and 0 deletions
36
include/arc/std/errno.h
Normal file
36
include/arc/std/errno.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef ARC_STD_ERRNO_H_
|
||||
#define ARC_STD_ERRNO_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define ARC_ERRNO_NULL -0x01
|
||||
#define ARC_ERRNO_DATA -0x02
|
||||
#define ARC_ERRNO_COPY -0x03
|
||||
#define ARC_ERRNO_EXISTS -0x04
|
||||
#define ARC_ERRNO_OVERFLOW -0x05
|
||||
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
static int32_t arc_errno = 0;
|
||||
// #pragma GCC diagnostic pop
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ARC_DEBUG
|
||||
# include <stdio.h>
|
||||
# define ARC_DEBUG_LOG(ERR, STR, ...) printf("[ERROR %d] " STR "\n", ERR, __VA_ARGS__)
|
||||
#else
|
||||
# define ARC_DEBUG_LOG(ERR, STR, ...)
|
||||
#endif
|
||||
|
||||
#define ARC_ERR_CHECK(FUNC) FUNC; if(arc_errno){ ARC_DEBUG_LOG(arc_errno, "%s", #FUNC); return; }
|
||||
|
||||
#endif //ARC_STD_ERRNO_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue