forked from mia/Aegisub
Move tellg() usage to the start of the block rather than at the end, otherwise it would always return -1. This should be harmless for windows.
Originally committed to SVN as r3269.
This commit is contained in:
parent
2522102465
commit
ffe628f29a
1 changed files with 5 additions and 2 deletions
|
@ -128,6 +128,10 @@ int main(int argc, const char *argv[]) {
|
||||||
|
|
||||||
while (iter.Next(&filename)) {
|
while (iter.Next(&filename)) {
|
||||||
ifstream infile(filename.char_str(), ios::binary);
|
ifstream infile(filename.char_str(), ios::binary);
|
||||||
|
infile.seekg(0, ios::end);
|
||||||
|
int infile_end = infile.tellg();
|
||||||
|
infile.seekg(0, ios::beg);
|
||||||
|
|
||||||
wxFileName file(filename);
|
wxFileName file(filename);
|
||||||
wxString identifier = file.GetName() + "_" + file.GetDirs().Last();
|
wxString identifier = file.GetName() + "_" + file.GetDirs().Last();
|
||||||
nameCleaner.ReplaceAll(&identifier, "_");
|
nameCleaner.ReplaceAll(&identifier, "_");
|
||||||
|
@ -141,8 +145,7 @@ int main(int argc, const char *argv[]) {
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
outC << "};" << endl;
|
outC << "};" << endl;
|
||||||
infile.seekg(ios_base::end);
|
outH << "extern const unsigned char " << identifier << "[" << infile_end << "];" << endl;
|
||||||
outH << "extern const unsigned char " << identifier << "[" << infile.tellg() << "];" << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue