Changeset - r18708:683e5888dbd3
[Not reviewed]
master
0 1 0
rubidium - 12 years ago 2011-12-17 12:19:22
rubidium@openttd.org
(svn r23566) -Fix (r23565): hopefully fix MSVC compilation error
1 file changed with 1 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/strgen/strgen.cpp
Show inline comments
 
@@ -921,25 +921,24 @@ struct FileWriter {
 
	}
 

	
 
	/** Finalise the writing. */
 
	void Finalise()
 
	{
 
		fclose(this->fh);
 
		this->fh = NULL;
 
	}
 

	
 
	/** Make sure the file is closed. */
 
	virtual ~FileWriter()
 
	{
 
		printf("close %s %p\n", this->filename, this->fh);
 
		/* If we weren't closed an exception was thrown, so remove the termporary file. */
 
		if (fh != NULL) {
 
			fclose(this->fh);
 
			unlink(this->filename);
 
		}
 
		free(this->filename);
 
	}
 
};
 

	
 
/** Base class for writing the header. */
 
struct HeaderWriter {
 
	/**
 
@@ -1014,25 +1013,25 @@ struct HeaderFileWriter : HeaderWriter, 
 
		);
 

	
 
		fprintf(this->fh, "#endif /* TABLE_STRINGS_H */\n");
 

	
 
		this->FileWriter::Finalise();
 

	
 
		if (CompareFiles(this->filename, this->real_filename)) {
 
			/* files are equal. tmp.xxx is not needed */
 
			unlink(this->filename);
 
		} else {
 
			/* else rename tmp.xxx into filename */
 
	#if defined(WIN32) || defined(WIN64)
 
			unlink(filename);
 
			unlink(this->real_filename);
 
	#endif
 
			if (rename(this->filename, this->real_filename) == -1) error("rename() failed");
 
		}
 
	}
 
};
 

	
 
static int TranslateArgumentIdx(int argidx, int offset)
 
{
 
	int sum;
 

	
 
	if (argidx < 0 || (uint)argidx >= lengthof(_cur_pcs.cmd)) {
 
		error("invalid argidx %d", argidx);
0 comments (0 inline, 0 general)