magically fix text output for Win32
This commit is contained in:
parent
aadfd878a9
commit
845c5e1845
3 changed files with 6 additions and 10 deletions
|
@ -7,10 +7,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcre", "lib\pcre\pcre.vcpro
|
|||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gdbm", "lib\gdbm\gdbm.vcproj", "{C41CD6E3-30A4-4BB9-BA51-F97B2CD77D56}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "lib\event\WIN32-Prj\libevent.vcproj", "{387B391F-49E3-4DBF-AC32-C97D8ADE78C7}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
|
@ -33,10 +29,6 @@ Global
|
|||
{934FCDE5-D077-4619-B79C-A62580EA1E4A}.Debug.Build.0 = Debug|Win32
|
||||
{934FCDE5-D077-4619-B79C-A62580EA1E4A}.Release.ActiveCfg = Release|Win32
|
||||
{934FCDE5-D077-4619-B79C-A62580EA1E4A}.Release.Build.0 = Release|Win32
|
||||
{C41CD6E3-30A4-4BB9-BA51-F97B2CD77D56}.Debug.ActiveCfg = Debug|Win32
|
||||
{C41CD6E3-30A4-4BB9-BA51-F97B2CD77D56}.Debug.Build.0 = Debug|Win32
|
||||
{C41CD6E3-30A4-4BB9-BA51-F97B2CD77D56}.Release.ActiveCfg = Release|Win32
|
||||
{C41CD6E3-30A4-4BB9-BA51-F97B2CD77D56}.Release.Build.0 = Release|Win32
|
||||
{387B391F-49E3-4DBF-AC32-C97D8ADE78C7}.Debug.ActiveCfg = Debug|Win32
|
||||
{387B391F-49E3-4DBF-AC32-C97D8ADE78C7}.Debug.Build.0 = Debug|Win32
|
||||
{387B391F-49E3-4DBF-AC32-C97D8ADE78C7}.Release.ActiveCfg = Release|Win32
|
||||
|
|
|
@ -259,7 +259,7 @@ static void dlog_write( const char *time, const char *level, const char *line )
|
|||
static int chanflag = 0;
|
||||
FILE *logfile;
|
||||
|
||||
logfile = fopen( "logs/debug.log", "a" );
|
||||
logfile = os_fopen( "logs/debug.log", "a" );
|
||||
if( logfile ) {
|
||||
os_fprintf( logfile, "%s %s %s - %s\n", time, level, GET_CUR_MODNAME(), line );
|
||||
fclose( logfile );
|
||||
|
@ -323,7 +323,7 @@ static void nlog_write( const char *time, const char *level, const char *line )
|
|||
if( !logentry )
|
||||
logentry = new_logentry();
|
||||
if( !logentry->logfile )
|
||||
logentry->logfile = fopen( logentry->logname, "a" );
|
||||
logentry->logfile = os_fopen( logentry->logname, "a" );
|
||||
if( !logentry->logfile ) {
|
||||
#ifdef DEBUG
|
||||
printf( "%s\n", strerror( errno ) );
|
||||
|
|
|
@ -96,6 +96,10 @@ FILE* os_fopen( const char *filename, const char *filemode )
|
|||
|
||||
retval = fopen( filename, filemode );
|
||||
os_errno = errno;
|
||||
/* magically fix win32 text outputs... */
|
||||
#ifdef WIN32
|
||||
_setmode( _fileno( retval ), _O_TEXT );
|
||||
#endif
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue