diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-22 22:22:29 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-22 22:22:29 +0200 |
commit | 5d0979480ff50390b3883795ec2093e0d3d6193b (patch) | |
tree | 34a5fc5d18cb2d9cc87c01e6eb2eb40e0f3d5050 /c/util.h | |
parent | 8566655b85f0a4e515d57f6686636db516116f95 (diff) | |
download | EpisodeBrowser-5d0979480ff50390b3883795ec2093e0d3d6193b.tar.gz |
Open episodes without Prolog.
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 |