mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-26 22:01:50 +00:00
made commandline fteqcc write to fteqcc.log
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2494 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
6a31083ed5
commit
834ed1c3dc
1 changed files with 26 additions and 1 deletions
|
@ -3364,6 +3364,28 @@ void Sys_Error(const char *text, ...)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USEGUI
|
#ifndef USEGUI
|
||||||
|
#include <stdarg.h>
|
||||||
|
FILE *logfile;
|
||||||
|
int logprintf(const char *format, ...)
|
||||||
|
{
|
||||||
|
va_list argptr;
|
||||||
|
static char string[1024];
|
||||||
|
|
||||||
|
va_start (argptr, format);
|
||||||
|
#ifdef _WIN32
|
||||||
|
_vsnprintf (string,sizeof(string)-1, format,argptr);
|
||||||
|
#else
|
||||||
|
vsnprintf (string,sizeof(string), format,argptr);
|
||||||
|
#endif
|
||||||
|
va_end (argptr);
|
||||||
|
|
||||||
|
puts(string);
|
||||||
|
if (logfile)
|
||||||
|
fputs(string, logfile);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int main (int argc, char **argv)
|
int main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
int sucess;
|
int sucess;
|
||||||
|
@ -3376,10 +3398,13 @@ int main (int argc, char **argv)
|
||||||
funcs.parms->ReadFile = QCC_ReadFile;
|
funcs.parms->ReadFile = QCC_ReadFile;
|
||||||
funcs.parms->FileSize = QCC_FileSize;
|
funcs.parms->FileSize = QCC_FileSize;
|
||||||
funcs.parms->WriteFile = QCC_WriteFile;
|
funcs.parms->WriteFile = QCC_WriteFile;
|
||||||
funcs.parms->printf = printf;
|
funcs.parms->printf = logprintf;
|
||||||
funcs.parms->Sys_Error = Sys_Error;
|
funcs.parms->Sys_Error = Sys_Error;
|
||||||
|
logfile = fopen("fteqcc.log", "wt");
|
||||||
sucess = CompileParams(&funcs, true, argc, argv);
|
sucess = CompileParams(&funcs, true, argc, argv);
|
||||||
qccClearHunk();
|
qccClearHunk();
|
||||||
|
if (logfile)
|
||||||
|
fclose(logfile);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// fgetc(stdin); //wait for keypress
|
// fgetc(stdin); //wait for keypress
|
||||||
|
|
Loading…
Reference in a new issue