From 5d0979480ff50390b3883795ec2093e0d3d6193b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 22 Aug 2022 22:22:29 +0200 Subject: Open episodes without Prolog. --- c/util.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'c/util.h') diff --git a/c/util.h b/c/util.h index 8281fc9..7ca8bfe 100644 --- a/c/util.h +++ b/c/util.h @@ -7,11 +7,22 @@ #include #include +#define CONCAT_IMPL(a, b) a##b +#define CONCAT(a, b) CONCAT_IMPL(a, b) +#define _ CONCAT(unused_, __LINE__) + inline size_t Min(size_t a, size_t b) { return a < b? a: b; } +inline int Cmp(const int a, const int b) +{ + if (a == b) return 0; + if (a > b) return 1; + return -1; +} + /* Buf is a span-like structure of a buffer and its size. */ template struct Buf @@ -58,15 +69,4 @@ inline char* Strcpy(Buf dst, const char* const src) return dst; } -inline int Cmp(const int a, const int b) -{ - if (a == b) return 0; - if (a > b) return 1; - return -1; -} - -#define CAT(a, b) a##b -#define APPLY(a, ...) a(__VA_ARGS__) -#define UNUSED APPLY(CAT, unused_, __COUNTER__) - #endif -- cgit v1.2.3