aboutsummaryrefslogtreecommitdiff
path: root/inc/_.h
blob: 4139005e979cb154ac56a4808d053f4316bfe33f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#pragma once
#include "cfg.h"
#include "TZR.h"
#include <time.h>

#define defer(X) if (atexit(X)) { X(); panic("defer"); }
#define auto __auto_type
#define foreach(E, L) for (auto E = (L); E != NULL; E = E->next)
#define forloop(I, F, T) for (auto I = F; I < T; I++)
#define with(I, T) auto I = (T); if (I)
#define plog(...) printf("\x1b[94mLOG %s:%s:%d\x1b[0m \t", __FILE_NAME__, __FUNCTION__, __LINE__), printf(__VA_ARGS__), putchar('\n')
#define panic(...) plog(__VA_ARGS__), exit(EXIT_FAILURE)