diff options
Diffstat (limited to 'c/util.h')
-rw-r--r-- | c/util.h | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -7,11 +7,22 @@ #include <SWI-Prolog.h> #include <windows.h> +#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 <typename T> struct Buf @@ -58,15 +69,4 @@ inline char* Strcpy(Buf<char> 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 |