Skip to content

Instantly share code, notes, and snippets.

@temurka1
Created August 18, 2022 18:42
Show Gist options
  • Select an option

  • Save temurka1/19e0959b260b039e7c37895dbea96f70 to your computer and use it in GitHub Desktop.

Select an option

Save temurka1/19e0959b260b039e7c37895dbea96f70 to your computer and use it in GitHub Desktop.
// Usage:
#define ENABLE_TRACE
#include "trace.h"
TRACE("\n\tx = " << vrt.X() << " y = " << vrt.Y() << " z = " << vrt.Z());
#ifdef ENABLE_TRACE
#ifdef _MSC_VER
#include <windows.h>
#include <sstream>
#define TRACE(x) do { std::stringstream s; s << x; OutputDebugStringA((LPCSTR)(s.str().c_str())); } while(0)
#else
#include <iostream>
#define TRACE(x) std::clog << (x)
#endif
#else
# define TRACE(x)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment