aboutsummaryrefslogtreecommitdiff
path: root/c/util.h
blob: babe0c5b777c8cfa79a7fc01ee00e230d49c3949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef UTIL_H
#define UTIL_H

#include <memory>

template<size_t N, typename... T>
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