_WCRTLINK int putch( int c ) { char ch; DWORD written; HANDLE h; ch = c; #ifdef DEFAULT_WINDOWING if( _WindowsPutch != 0 ) { LPWDATA res; res = _WindowsIsWindowedHandle( STDOUT_FILENO ); _WindowsPutch( res, c ); } else { #endif written = 0; h = __NTConsoleOutput(); // obtain a console output handle if( h != INVALID_HANDLE_VALUE ) { WriteConsole( h, &ch, 1, &written, NULL ); } if( written == 0 ) return( -1 ); #ifdef DEFAULT_WINDOWING } #endif return( c ); }
_WCRTLINK int putch( int c ) { #ifdef DEFAULT_WINDOWING if( _WindowsPutch != NULL ) { LPWDATA res; res = _WindowsIsWindowedHandle( STDOUT_FILENO ); _WindowsPutch( res, c ); } #else _dos( DOS_OUTPUT_CHAR, c ); #endif return( c ); }