aboutsummaryrefslogtreecommitdiff
path: root/c/util.h
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-22 22:22:29 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-22 22:22:29 +0200
commit5d0979480ff50390b3883795ec2093e0d3d6193b (patch)
tree34a5fc5d18cb2d9cc87c01e6eb2eb40e0f3d5050 /c/util.h
parent8566655b85f0a4e515d57f6686636db516116f95 (diff)
downloadEpisodeBrowser-5d0979480ff50390b3883795ec2093e0d3d6193b.tar.gz
Open episodes without Prolog.
Diffstat (limited to 'c/util.h')
-rw-r--r--c/util.h22
1 files changed, 11 insertions, 11 deletions
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 <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