123456789101112131415161718192021 |
- #pragma once
- #include "libc.h"
- #define STR1(m) #m
- #define STR(m) STR1(m)
- #define PRINTF(fmt, ...) XPRINTF(__FILE__ ":" STR(__LINE__) ": " fmt "\n", __VA_ARGS__)
- #define PRINT(msg) XPRINTF(__FILE__ ":" STR(__LINE__) ": %s\n", msg)
- void XPRINTF(const char* fmt, ...);
- #define ASSERT(cond) if (!(cond)){PRINTF("%s failed", #cond); abort();}
- #define COUNTOF(a) (sizeof(a) / sizeof(*(a)))
- typedef struct {
- const char *str;
- int length;
- } StringView;
- #define PRI_SV "%.*s"
- #define PRI_SVV(s) ((s).length), ((s).str)
|