project_files/hwc/rtl/fileio.c
changeset 10575 13b1e9008f4b
parent 9966 01e198990211
child 11682 2c21bc80c95d
equal deleted inserted replaced
10574:1636b0efa415 10575:13b1e9008f4b
   160     fprintf(f, "%s", s.str);
   160     fprintf(f, "%s", s.str);
   161 }
   161 }
   162 
   162 
   163 void __attribute__((overloadable)) fpcrtl_writeLn(File f, string255 s) {
   163 void __attribute__((overloadable)) fpcrtl_writeLn(File f, string255 s) {
   164     FIX_STRING(s);
   164     FIX_STRING(s);
   165     fprintf(f->fp, "%s\n", s.str);
   165     // filthy hack to write to stderr
       
   166     if (!f->fp)
       
   167         fprintf(stderr, "%s\n", s.str);
       
   168     else
       
   169         fprintf(f->fp, "%s\n", s.str);
   166 }
   170 }
   167 
   171 
   168 void __attribute__((overloadable)) fpcrtl_writeLn(FILE *f, string255 s) {
   172 void __attribute__((overloadable)) fpcrtl_writeLn(FILE *f, string255 s) {
   169     FIX_STRING(s);
   173     FIX_STRING(s);
   170     fprintf(f, "%s\n", s.str);
   174     fprintf(f, "%s\n", s.str);