allow assembler to read from STDIN
This commit is contained in:
		
							parent
							
								
									f2dc30c912
								
							
						
					
					
						commit
						8fc22f0db7
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
					@ -149,13 +149,13 @@ char **argv;
 | 
				
			||||||
		if (nfile != 0)
 | 
							if (nfile != 0)
 | 
				
			||||||
			fatal("second source file %s", p);
 | 
								fatal("second source file %s", p);
 | 
				
			||||||
		nfile++;
 | 
							nfile++;
 | 
				
			||||||
#endif
 | 
					#else
 | 
				
			||||||
		if (p[0] == '-' && p[1] == '\0') {
 | 
							if (p[0] == '-' && p[1] == '\0') {
 | 
				
			||||||
			input = stdin;
 | 
								input = stdin;
 | 
				
			||||||
			parse("STDIN");
 | 
								parse("STDIN");
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		if ((input = fopen(p, "r")) == NULL)
 | 
							if ((input = fopen(p, "r")) == NULL)
 | 
				
			||||||
			fatal("can't open %s", p);
 | 
								fatal("can't open %s", p);
 | 
				
			||||||
#ifdef ASLD
 | 
					#ifdef ASLD
 | 
				
			||||||
| 
						 | 
					@ -174,6 +174,12 @@ char **argv;
 | 
				
			||||||
		parse(p);
 | 
							parse(p);
 | 
				
			||||||
		fclose(input);
 | 
							fclose(input);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					#ifndef ASLD
 | 
				
			||||||
 | 
						if (nfile == 0) {
 | 
				
			||||||
 | 
							input = stdin;
 | 
				
			||||||
 | 
							parse("STDIN");
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
	commfinish();
 | 
						commfinish();
 | 
				
			||||||
	machfinish(PASS_1);
 | 
						machfinish(PASS_1);
 | 
				
			||||||
#ifdef ASLD
 | 
					#ifdef ASLD
 | 
				
			||||||
| 
						 | 
					@ -195,8 +201,10 @@ char **argv;
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
	if (unresolved)
 | 
						if (unresolved)
 | 
				
			||||||
		outhead.oh_flags |= HF_LINK;
 | 
							outhead.oh_flags |= HF_LINK;
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
	if (nfile == 0)
 | 
						if (nfile == 0)
 | 
				
			||||||
		fatal("no source file");
 | 
							fatal("no source file");
 | 
				
			||||||
 | 
						*/
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue