1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
--- lib/libimhex/source/helpers/file.cpp.orig 2022-08-17 21:25:52 UTC
+++ lib/libimhex/source/helpers/file.cpp
@@ -17,12 +17,12 @@ namespace hex::fs {
this->m_file = _wfopen(path.c_str(), L"w+b");
#else
if (mode == File::Mode::Read)
- this->m_file = fopen64(path.string().c_str(), "rb");
+ this->m_file = fopen(path.string().c_str(), "rb");
else if (mode == File::Mode::Write)
- this->m_file = fopen64(path.string().c_str(), "r+b");
+ this->m_file = fopen(path.string().c_str(), "r+b");
if (mode == File::Mode::Create || (mode == File::Mode::Write && this->m_file == nullptr))
- this->m_file = fopen64(path.string().c_str(), "w+b");
+ this->m_file = fopen(path.string().c_str(), "w+b");
#endif
}
@@ -50,7 +50,7 @@ namespace hex::fs {
void File::seek(u64 offset) {
- fseeko64(this->m_file, offset, SEEK_SET);
+ fseeko(this->m_file, offset, SEEK_SET);
}
void File::close() {
@@ -135,10 +135,10 @@ namespace hex::fs {
size_t File::getSize() const {
if (!isValid()) return 0;
- auto startPos = ftello64(this->m_file);
- fseeko64(this->m_file, 0, SEEK_END);
- auto size = ftello64(this->m_file);
- fseeko64(this->m_file, startPos, SEEK_SET);
+ auto startPos = ftello(this->m_file);
+ fseeko(this->m_file, 0, SEEK_END);
+ auto size = ftello(this->m_file);
+ fseeko(this->m_file, startPos, SEEK_SET);
if (size < 0)
return 0;
@@ -149,7 +149,7 @@ namespace hex::fs {
void File::setSize(u64 size) {
if (!isValid()) return;
- auto result = ftruncate64(fileno(this->m_file), size);
+ auto result = ftruncate(fileno(this->m_file), size);
hex::unused(result);
}
|