Skip to content

Instantly share code, notes, and snippets.

@pervognsen
Created September 26, 2014 07:29
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 pervognsen/5a1adf83f6d7a2499337 to your computer and use it in GitHub Desktop.
Save pervognsen/5a1adf83f6d7a2499337 to your computer and use it in GitHub Desktop.
SDL_DebugOutput
/**
* \brief Outputs an ASCII string that will be visible in a debugger.
* \note Uses OutputDebugStringA on Windows. Prints to stderr on all other platforms.
*/
extern DECLSPEC void SDLCALL SDL_DebugOutput(const char *str);
void SDL_DebugOutput(const char *str)
{
#if defined(__WIN32__) || defined(__WINRT__)
OutputDebugStringA(str);
#elif HAVE_STDIO_H
fputs(str, stderr);
#if __NACL__
fflush(stderr);
#endif
#else
#error Not implemented on this platform.
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment