mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-24 16:11:20 +00:00
Core: Buildfix.
This commit is contained in:
parent
94a14bde27
commit
9dced68812
@ -59,10 +59,6 @@ inline u64 __rotr64(u64 x, unsigned int shift){
|
|||||||
return (x >> n) | (x << (64 - n));
|
return (x >> n) | (x << (64 - n));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef linux
|
|
||||||
#define pread64 pread
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else // WIN32
|
#else // WIN32
|
||||||
|
|
||||||
// Function Cross-Compatibility
|
// Function Cross-Compatibility
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
// Official git repository and contact information can be found at
|
// Official git repository and contact information can be found at
|
||||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
#include "ppsspp_config.h"
|
#include "ppsspp_config.h"
|
||||||
#include "util/text/utf8.h"
|
#include "util/text/utf8.h"
|
||||||
#include "file/file_util.h"
|
#include "file/file_util.h"
|
||||||
@ -36,9 +37,15 @@ LocalFileLoader::LocalFileLoader(const std::string &filename)
|
|||||||
if (fd_ == -1) {
|
if (fd_ == -1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#if defined(__ANDROID__) || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64)
|
||||||
off64_t off = lseek64(fd_, 0, SEEK_END);
|
off64_t off = lseek64(fd_, 0, SEEK_END);
|
||||||
filesize_ = off;
|
filesize_ = off;
|
||||||
lseek64(fd_, 0, SEEK_SET);
|
lseek64(fd_, 0, SEEK_SET);
|
||||||
|
#else
|
||||||
|
off_t off = lseek(fd_, 0, SEEK_END);
|
||||||
|
filesize_ = off;
|
||||||
|
lseek(fd_, 0, SEEK_SET);
|
||||||
|
#endif
|
||||||
|
|
||||||
#else // !_WIN32
|
#else // !_WIN32
|
||||||
|
|
||||||
@ -104,7 +111,11 @@ std::string LocalFileLoader::Path() const {
|
|||||||
|
|
||||||
size_t LocalFileLoader::ReadAt(s64 absolutePos, size_t bytes, size_t count, void *data, Flags flags) {
|
size_t LocalFileLoader::ReadAt(s64 absolutePos, size_t bytes, size_t count, void *data, Flags flags) {
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64
|
||||||
return pread64(fd_, data, bytes * count, absolutePos) / bytes;
|
return pread64(fd_, data, bytes * count, absolutePos) / bytes;
|
||||||
|
#else
|
||||||
|
return pread(fd_, data, bytes * count, absolutePos) / bytes;
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
DWORD read = -1;
|
DWORD read = -1;
|
||||||
OVERLAPPED offset = { 0 };
|
OVERLAPPED offset = { 0 };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user