X-Git-Url: http://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/4c9cb9b99991c36920bd17e366e2128d1b22eb6e..refs/tags/v0.90.4:/src/out.c diff --git a/src/out.c b/src/out.c index df0d7f5..6b3f48f 100644 --- a/src/out.c +++ b/src/out.c @@ -7,6 +7,8 @@ extern FILE *out; extern FILE *outh; +extern gboolean for_cpp; + extern char *filename; extern char *filebase; @@ -28,9 +30,10 @@ out_printf(FILE *fp,char *format,...) { va_list ap; char *s; + va_start(ap,format); - s = g_strdup_vprintf(format,ap); + va_end(ap); if(fp == out) outline += strchrcnt(s,'\n'); @@ -41,8 +44,6 @@ out_printf(FILE *fp,char *format,...) fprintf(fp,"%s",s); g_free(s); - - va_end(ap); } void @@ -63,7 +64,10 @@ out_addline_outfile(FILE *fp) { if(fp == out) { outline++; - fprintf(fp,"#line %d \"%s.c\"\n",outline,filebase); + if(!for_cpp) + fprintf(fp,"#line %d \"%s.c\"\n",outline,filebase); + else + fprintf(fp,"#line %d \"%s.cc\"\n",outline,filebase); } else if(fp == outh) { outhline++; fprintf(fp,"#line %d \"%s.h\"\n",outhline,filebase);