Skip to content

Instantly share code, notes, and snippets.

@nibasya
Last active February 23, 2020 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nibasya/77d12f726b26a073909de4ae5e93ba0b to your computer and use it in GitHub Desktop.
Save nibasya/77d12f726b26a073909de4ae5e93ba0b to your computer and use it in GitHub Desktop.
TCHAR version of _RPTN functions
#pragma once
#ifndef _DEBUG
#define _RPTT0(msg)
#define _RPTTN(msg, ...)
#define _RPTFT0(msg)
#define _RPTFTN(msg, ...)
#else // ifndef _DEBUG else
#ifdef UNICODE
#define _RPTT0(msg) _RPT_BASE_W(_CRT_WARN, NULL, 0, NULL, L"%ls", msg)
#define _RPTTN(msg, ...) _RPT_BASE_W(_CRT_WARN, NULL, 0, NULL, msg, __VA_ARGS__)
#define _RPTFT0(msg) _RPT_BASE_W(_CRT_WARN, _CRT_WIDE(__FILE__), __LINE__, NULL, L"%ls", msg)
#define _RPTFTN(msg, ...) _RPT_BASE_W(_CRT_WARN, _CRT_WIDE(__FILE__), __LINE__, NULL, msg, __VA_ARGS__)
#else // ifdef UNICODE else
#define _RPTT0(msg) _RPT_BASE(_CRT_WARN, NULL, 0, NULL, "%s", msg)
#define _RPTTN(msg, ...) _RPT_BASE(_CRT_WARN, NULL, 0, NULL, msg, __VA_ARGS__)
#define _RPTFT0(msg) _RPT_BASE(_CRT_WARN, __FILE__, __LINE__, NULL, "%s", msg)
#define _RPTFTN(msg, ...) _RPT_BASE(_CRT_WARN, __FILE__, __LINE__, NULL, msg, __VA_ARGS__)
#endif // ifdef UNICODE
#endif // ifndef _DEBUG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment