// util.h

#pragma once
#include "stdafx.h"

// Project string types
#undef TCHAR_USE_WCHAR_T
#ifdef _WIN32
	#define TCHAR_USE_WCHAR_T
#endif
#ifdef TCHAR_USE_WCHAR_T
	#define __T(x) L ## x
	#define _T(x) __T(x)
	typedef wchar_t TCHAR;
	typedef std::wstring TSTRING;
	#define _vstprintf_s vswprintf_s
	#define _tcscpy_s    wcscpy_s
	#define _tcsstr      wcsstr
#else
	#define _T(x) x
	typedef char TCHAR;
	typedef std::string TSTRING;
	#define _vstprintf_s vsprintf_s
	#define _tcscpy_s    strcpy_s
	#define _tcsstr      strstr
#endif

// Functions in Util.cpp

TSTRING format(const TCHAR *fmt, ...);
TSTRING TSTRINGify(const char* cstr);
