+#ifdef _WIN32
+ if ( logging_enabled ) {
+ if ( !has_console ) {
+ AllocConsole();
+ freopen("conin$", "r", stdin);
+ freopen("conout$", "w", stdout);
+ freopen("conout$", "w", stderr);
+ has_console = true;
+ }
+ return sbuf->sputc(c);
+ }
+ else
+ return EOF == 0 ? 1: 0;
+#else