[SDL] Getting rid of stdout redirect
usenetNOSPAM at jimrandomh.org
Sat Jan 15 16:07:17 PST 2005
By default, SDLmain redirects stdout and stderr to files. This is a
configure-time option in the static portion of the library. For my
program, this is blatantly wrong behavior and not acceptable (dedicated
server using SDL that's expected to be interactive on stdin/stdout).
Now, I can recompile SDL to not do this, but...
I can't really tell someone who downloads a source tarball that they
need to recompile SDL with a nonstandard option, and I *certainly*
can't make a configure check for it. My present workaround is to
compile SDL_win32_main.c directly into the project with
NO_STDIO_REDIRECT defined, but that's clearly an ugly hack/bad idea.
Is there any way to *cleanly* work around this? Better behavior would
be for SDL to wait until sdlInit is called, and provide an option to
control whether stdio should be redirected. Or best of all, just drop
the redirection thing entirely and provide a library function for it.
CalcRogue: TI-89, TI-92+, PalmOS, Windows and Linux.
More information about the SDL