comparison lwasm/pseudo.c @ 261:c79b3c88adbc 2.x

Added --depend option to generate a list of dependencies
author lost
date Sat, 26 Dec 2009 08:24:35 +0000
parents e27279180a73
children
comparison
equal deleted inserted replaced
260:1bdb4e256fc9 261:c79b3c88adbc
166 as -> context = lwasm_next_context(as); 166 as -> context = lwasm_next_context(as);
167 if (lwasm_read_file(as, fn) < 0) 167 if (lwasm_read_file(as, fn) < 0)
168 { 168 {
169 register_error(as, l, 1, "File include error (%s)", fn); 169 register_error(as, l, 1, "File include error (%s)", fn);
170 } 170 }
171 lwasm_free(fn); 171 as -> incfiles = lwasm_realloc(as -> incfiles, sizeof(char *) * (as -> nincfiles + 1));
172 as -> incfiles[as -> nincfiles++] = fn;
172 } 173 }
173 174
174 /* 175 /*
175 The operand for includebin is a string optionally enclosed in " 176 The operand for includebin is a string optionally enclosed in "
176 */ 177 */
224 register_error(as, l, 1, "Cannot open file: %s", strerror(errno)); 225 register_error(as, l, 1, "Cannot open file: %s", strerror(errno));
225 register_error(as, l, 2, "Cannot open file: %s", strerror(errno)); 226 register_error(as, l, 2, "Cannot open file: %s", strerror(errno));
226 } 227 }
227 228
228 // don't need fn any more 229 // don't need fn any more
229 lwasm_free(fn); 230 as -> incfiles = lwasm_realloc(as -> incfiles, sizeof(char *) * (as -> nincfiles + 1));
231 as -> incfiles[as -> nincfiles++] = fn;
230 232
231 // read the contents of the file and "emit()" it 233 // read the contents of the file and "emit()" it
232 while (!feof(f) && !ferror(f)) 234 while (!feof(f) && !ferror(f))
233 { 235 {
234 v1 = fgetc(f); 236 v1 = fgetc(f);