mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	Merged a few fixes for non-posix systems from github.com/Siesh1oo/yosys
(see https://github.com/cliffordwolf/yosys/pull/28)
This commit is contained in:
		
							parent
							
								
									9992026a8d
								
							
						
					
					
						commit
						91704a7853
					
				
					 11 changed files with 52 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -26,6 +26,8 @@
 | 
			
		|||
#include <stdio.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <dirent.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include <limits.h>
 | 
			
		||||
 | 
			
		||||
struct Vhdl2verilogPass : public Pass {
 | 
			
		||||
	Vhdl2verilogPass() : Pass("vhdl2verilog", "importing VHDL designs using vhdl2verilog") { }
 | 
			
		||||
| 
						 | 
				
			
			@ -93,9 +95,12 @@ struct Vhdl2verilogPass : public Pass {
 | 
			
		|||
			log_error("For some reason mkdtemp() failed!\n");
 | 
			
		||||
 | 
			
		||||
		if (!out_file.empty() && out_file[0] != '/') {
 | 
			
		||||
			char *pwd = get_current_dir_name();
 | 
			
		||||
			char pwd [PATH_MAX];
 | 
			
		||||
			if (!getcwd(pwd, sizeof(pwd))) {
 | 
			
		||||
				log_cmd_error("getcwd failed: %s", strerror(errno));
 | 
			
		||||
				log_abort();
 | 
			
		||||
			}
 | 
			
		||||
			out_file = pwd + ("/" + out_file);
 | 
			
		||||
			free(pwd);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		FILE *f = fopen(stringf("%s/files.list", tempdir_name).c_str(), "wt");
 | 
			
		||||
| 
						 | 
				
			
			@ -104,9 +109,12 @@ struct Vhdl2verilogPass : public Pass {
 | 
			
		|||
			if (file.empty())
 | 
			
		||||
				continue;
 | 
			
		||||
			if (file[0] != '/') {
 | 
			
		||||
				char *pwd = get_current_dir_name();
 | 
			
		||||
				char pwd [PATH_MAX];
 | 
			
		||||
				if (!getcwd(pwd, sizeof(pwd))) {
 | 
			
		||||
					log_cmd_error("getcwd failed: %s", strerror(errno));
 | 
			
		||||
					log_abort();
 | 
			
		||||
				}
 | 
			
		||||
				file = pwd + ("/" + file);
 | 
			
		||||
				free(pwd);
 | 
			
		||||
			}
 | 
			
		||||
			fprintf(f, "%s\n", file.c_str());
 | 
			
		||||
			log("Adding '%s' to the file list.\n", file.c_str());
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue