Compare commits
2 commits
995813279f
...
17e458b4e7
| Author | SHA1 | Date | |
|---|---|---|---|
| 17e458b4e7 | |||
| d17c8ea847 |
1 changed files with 7 additions and 3 deletions
10
src/base.c
10
src/base.c
|
|
@ -9,12 +9,12 @@ typedef void (^__defer_block_t)(void);
|
||||||
|
|
||||||
static inline void __defer_exec(__defer_block_t *blk) { (*blk)(); }
|
static inline void __defer_exec(__defer_block_t *blk) { (*blk)(); }
|
||||||
|
|
||||||
#define __cat_2(a, b) a##b
|
#define __concat__2(a, b) a##b
|
||||||
#define __cat_1(a, b) __cat_2(a, b)
|
#define __concat(a, b) __concat__2(a, b)
|
||||||
|
|
||||||
#define scope_exit \
|
#define scope_exit \
|
||||||
__attribute__((cleanup(__defer_exec), unused)) \
|
__attribute__((cleanup(__defer_exec), unused)) \
|
||||||
__defer_block_t __cat_1(_defer_, __LINE__) = ^
|
__defer_block_t __concat(_defer_, __LINE__) = ^
|
||||||
|
|
||||||
#define auto __auto_type
|
#define auto __auto_type
|
||||||
|
|
||||||
|
|
@ -36,6 +36,10 @@ typedef uintptr_t uintptr;
|
||||||
typedef size_t usize;
|
typedef size_t usize;
|
||||||
typedef ptrdiff_t ssize;
|
typedef ptrdiff_t ssize;
|
||||||
|
|
||||||
|
typedef int64_t sint;
|
||||||
|
typedef uint64_t uint;
|
||||||
|
|
||||||
|
|
||||||
// Thanks AZMR
|
// Thanks AZMR
|
||||||
#define cast(to_type, expr) ((to_type)(expr))
|
#define cast(to_type, expr) ((to_type)(expr))
|
||||||
#define chkcast(to_type, from_type, expr) _Generic(expr, from_type: (to_type)(expr))
|
#define chkcast(to_type, from_type, expr) _Generic(expr, from_type: (to_type)(expr))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue