From 04daecdd21e86e7556a9462380096530228cd6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 3 Aug 2022 21:57:27 +0200 Subject: Split common.h to util.h, wcharptr.h and win.h. --- c/util.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 c/util.h (limited to 'c/util.h') diff --git a/c/util.h b/c/util.h new file mode 100644 index 0000000..babe0c5 --- /dev/null +++ b/c/util.h @@ -0,0 +1,19 @@ +#ifndef UTIL_H +#define UTIL_H + +#include + +template +inline int Swprintf(wchar_t (&buf)[N], const wchar_t* const fmt, T... xs) +{ + return _snwprintf_s(buf, N, _TRUNCATE, fmt, xs...); +} + +inline int Cmp(const int a, const int b) +{ + if (a == b) return 0; + if (a > b) return 1; + return -1; +} + +#endif -- cgit v1.2.3