diff options
author | kdx <kikoodx@paranoici.org> | 2024-01-16 21:16:37 +0100 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2024-01-16 21:18:04 +0100 |
commit | d1503291d0fc33ca3a18e63bb548796567b8e9b5 (patch) | |
tree | 0dd77cd76a0e50c4f4dcc656e1b9d9fec293856f | |
parent | af2baacc0ccd6fc3ebd58b4e314f8bc80361c416 (diff) | |
download | cminus-d1503291d0fc33ca3a18e63bb548796567b8e9b5.tar.gz |
appr
-rw-r--r-- | _.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -55,6 +55,12 @@ void *_realloc(void *ptr, size_t size); const auto ___y = (Y); \ (___x < ___y) ? ___x : ___y; \ }) +#define appr(X, Y, S) ({ \ + const auto __x_ = (X); \ + const auto __y_ = (Y); \ + const auto __s_ = (S); \ + (__x_ > __y_) ? max(__x_ - __s_, __y_) : min(__x_ + __s_, __y_); \ +}) #define STR(X) #X #define defer(X) if (atexit(X)) { X(); panic("defer"); } |