Not logged in
Diff

Differences From Artifact [107ac675c7]:

  • File src/translate.c — part of check-in [331b57b53f] at 2011-10-29 20:06:41 on branch steveb-fixes — Ensure correct file name on compile errors in translated sources. This helps avoid editing the generated file with vim "quickfix". (user: steveb size: 5543) [more...]

To Artifact [3a88f86520]:

  • File src/translate.c — part of check-in [e36ad719cf] at 2011-11-05 01:30:43 on branch jimtcl — Attempt to build with MSVC. (user: mistachkin size: 5701) [more...]

158
159
160
161
162
163
164

165
166
167
168
169
170








171
172
173
174
175
176
177
      }
    }      
  }
}

int main(int argc, char **argv){
  if( argc==2 ){

    FILE *in = fopen(argv[1], "r");
    if( in==0 ){
      fprintf(stderr,"can not open %s\n", argv[1]);
      exit(1);
    }
    printf("#line 1 \"%s\"\n", argv[1]);








    trans(in, stdout);
    fclose(in);
  }else{
    trans(stdin, stdout);
  }
  return 0;
}







>





|
>
>
>
>
>
>
>
>







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
      }
    }      
  }
}

int main(int argc, char **argv){
  if( argc==2 ){
    char *arg;
    FILE *in = fopen(argv[1], "r");
    if( in==0 ){
      fprintf(stderr,"can not open %s\n", argv[1]);
      exit(1);
    }
    printf("#line 1 \"");
    for(arg=argv[1]; *arg; arg++){
      if( *arg!='\\' ){
        printf("%c", *arg);
      }else{
        printf("\\\\");
      }
    }
    printf("\"\n");
    trans(in, stdout);
    fclose(in);
  }else{
    trans(stdin, stdout);
  }
  return 0;
}