Created
November 22, 2011 17:12
-
-
Save tsukkee/1386238 to your computer and use it in GitHub Desktop.
Macro for OutputDebugString (for Windows)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <tchar.h> | |
#include <sstream> | |
typedef std::basic_stringstream<TCHAR> tstringstream; | |
template<typename T> tstringstream& operator,(tstringstream& tss, T t) { tss << _T(" ") << t; return tss; } | |
#define OUTPUT_DEBUG_STRING(...) ::OutputDebugString((tstringstream(), _T("***"), __VA_ARGS__, _T("\n")).str().c_str()); | |
int main(int argc, char *argv[]) { | |
OUTPUT_DEBUG_STRING(_T("abc"), 1, 2.3, true); // -> " *** abc 1 2.3 1" | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment