Fix std::{min,max} calls on architectures where long != int64
This commit is contained in:
parent
2a742182d8
commit
ad35b7ffd3
1 changed files with 3 additions and 2 deletions
|
@ -111,13 +111,14 @@ static Sint64 ofs_size (struct SDL_RWops * context) {
|
|||
|
||||
typedef std::pair<Sint64, std::ios_base::seekdir> offset_dir;
|
||||
static offset_dir translate_seekdir(Sint64 offset, int whence) {
|
||||
Sint64 zero = 0;
|
||||
switch(whence){
|
||||
case RW_SEEK_SET:
|
||||
return std::make_pair(std::max(0l, offset), std::ios_base::beg);
|
||||
return std::make_pair(std::max(zero, offset), std::ios_base::beg);
|
||||
case RW_SEEK_CUR:
|
||||
return std::make_pair(offset, std::ios_base::cur);
|
||||
case RW_SEEK_END:
|
||||
return std::make_pair(std::min(0l, offset), std::ios_base::end);
|
||||
return std::make_pair(std::min(zero, offset), std::ios_base::end);
|
||||
default:
|
||||
assert(false);
|
||||
throw "assertion ignored";
|
||||
|
|
Loading…
Add table
Reference in a new issue