# HG changeset patch # User kono # Date 1082949439 -32400 # Node ID 82a55cc6b5fc9d5ff19683a3dc9cd8c2bac56b4a # Parent 1ac647873577f86895c0101ffb7d18e46b2ea08f *** empty log message *** diff -r 1ac647873577 -r 82a55cc6b5fc Changes --- a/Changes Mon Apr 26 11:01:43 2004 +0900 +++ b/Changes Mon Apr 26 12:17:19 2004 +0900 @@ -4050,3 +4050,5 @@ 一応、no long long は通ったみたいだが。。 構造体の戻値を持つ場合に、引数がないとうまくいかない。 + +#include "" は、今読んでいるファイルのcurrent directry も探す。 diff -r 1ac647873577 -r 82a55cc6b5fc Makefile --- a/Makefile Mon Apr 26 11:01:43 2004 +0900 +++ b/Makefile Mon Apr 26 12:17:19 2004 +0900 @@ -92,11 +92,12 @@ ( cd nkf203; $(CC) -g -o nkf nkf.s utf8tbl.s ) ( cd nkf203; perl test.pl ) +# -./$(MC) -Itest/ -s $(TARGET).c check: $(MC) -gcc $(TARGET).c -o b.out $(MLIB) -./b.out > $(TARGET).gcc.out - -./$(MC) -Itest/ -s $(TARGET).c + -./$(MC) -s $(TARGET).c -gcc $(TARGET).s $(MLIB) -./a.out > $(TARGET).$(MC).out -diff $(TARGET).gcc.out $(TARGET).$(MC).out diff -r 1ac647873577 -r 82a55cc6b5fc mc-code-ia32.c --- a/mc-code-ia32.c Mon Apr 26 11:01:43 2004 +0900 +++ b/mc-code-ia32.c Mon Apr 26 12:17:19 2004 +0900 @@ -23,6 +23,8 @@ static int output_mode = TEXT_EMIT_MODE; static int data_alignment = 0; +static int creg; + int size_of_int = 4; int size_of_short = 2; int size_of_float = 4; diff -r 1ac647873577 -r 82a55cc6b5fc mc-parse.c --- a/mc-parse.c Mon Apr 26 11:01:43 2004 +0900 +++ b/mc-parse.c Mon Apr 26 12:17:19 2004 +0900 @@ -111,6 +111,9 @@ int include_path_count; extern char *l_include_path[]; +static +char current_file_dir[LBUFSIZE]; + int main(int argc, char **argv) { @@ -121,6 +124,8 @@ lsrc = chk = asmf = 0; ac=argc; av=argv; + current_file_dir[0] = 0; + include_path[include_path_count++] = current_file_dir; for (ac2=1; (ac2 < ac) && (*av[ac2] == '-'); ++ac2) { switch (*(av[ac2]+1)) { case 's': @@ -172,6 +177,8 @@ /*NOTREACHED*/ } +static void copy_current_file_dir(char *name); + void error(int n) { @@ -180,6 +187,7 @@ fclose(filep->fcb); lineno=filep->ln; --filep; + copy_current_file_dir(filep->name0); return; } else if(ac2!=ac) { fclose(filep->fcb); @@ -331,6 +339,19 @@ getch(); } +static void +copy_current_file_dir(char *name) +{ + char *s = name; + char *d = current_file_dir; + char *p; + for(p = d;dfcb = fopen(av[ac2++],"r")) == NULL ) error(FILERR); s = av[ac2-1]; + copy_current_file_dir(s); filep->name0 = cheapp; filep->inc = 0; while((*cheapp++ = *s++)); @@ -4201,7 +4223,7 @@ } } if(!fp) { error(FILERR); return filep->fcb; } - s = p; + copy_current_file_dir(s=p); (filep+1)->name0 = cheapp; (filep+1)->inc = end; while((*cheapp++ = *s++));