Something went wrong. Try again.
Cider Isn't Darwin Emulation, Really
Something went wrong. Try again.
4.0 kB · 287 lines
C++
at android
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288/*This file is part of Darling.
Copyright (C) 2012-2013 Lubos Dolezel
Darling is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either version 3 of the License, or(at your option) any later version.
Darling is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See theGNU General Public License for more details.
You should have received a copy of the GNU General Public Licensealong with Darling. If not, see <http://www.gnu.org/licenses/>.*/
#include "Math64.h"#include <limits>
int64_t S64Max(){ return std::numeric_limits<int64_t>::max();}
int64_t S64Min(){ return std::numeric_limits<int64_t>::min();}
int64_t S64Add(int64_t v1, int64_t v2){ return v1 + v2;}
int64_t S64Subtract(int64_t v1, int64_t v2){ return v1 - v2;}
int64_t S64Negate(int64_t v){ return -v;}
int64_t S64Absolute(int64_t v){ return (v >= 0) ? v : -v;}
int64_t S64Multiply(int64_t v1, int64_t v2){ return v1 * v2;}
int64_t S64Mod(int64_t divd, int64_t divs){ return divd % divs;}
int64_t S64Divide(int64_t divd, int64_t divs, int64_t* rem){ if (rem) *rem = divd % divs; return divd / divs;}
int64_t S64Div(int64_t divd, int64_t divs){ return divd / divs;}
int64_t S64Set(int32_t v){ return v;}
int64_t S64SetU(uint32_t v){ return v;}
int32_t S32Set(int64_t v){ return int32_t(v);}
int S64And(int64_t v1, int64_t v2){ return v1 && v2;}
int S64Or(int64_t v1, int64_t v2){ return v1 || v2;}
int S64Eor(int64_t v1, int64_t v2){ return !!(v1 ^ v2);}
int S64Not(int64_t v){ return !v;}
int32_t S64Compare(int64_t l, int64_t r){ if (l > r) return 1; else if (l < r) return -1; else return 0;}
int64_t S64BitwiseAnd(int64_t v1, int64_t v2){ return v1 & v2;}
int64_t S64BitwiseOr(int64_t v1, int64_t v2){ return v1 | v2;}
int64_t S64BitwiseEor(int64_t v1, int64_t v2){ return v1 ^ v2;}
int64_t S64BitwiseNor(int64_t v1){ return ~v1;}
int64_t S64ShiftRight(int64_t v, uint32_t shift){ return v >> shift;}
int64_t S64ShiftLeft(int64_t v, uint32_t shift){ return v << shift;}
long double S64ToLongDouble(int64_t v){ return v;}
int64_t LongDoubleToSInt64(long double v){ return int64_t(v);}
uint64_t U64Max(){ return std::numeric_limits<uint64_t>::max();}
uint64_t U64Add(uint64_t v1, uint64_t v2){ return v1 + v2;}
uint64_t U64Subtract(uint64_t v1, uint64_t v2){ return v1 - v2;}
uint64_t U64Multiply(uint64_t v1, uint64_t v2){ return v1 * v2;}
uint64_t U64Mod(uint64_t divd, uint64_t divs){ return divd / divs;}
uint64_t U64Divide(uint64_t divd, uint64_t divs, uint64_t* rem){ if (rem) *rem = divd % divs; return divd / divs;}
uint64_t U64Div(uint64_t divd, uint64_t divs){ return divd / divs;}
uint64_t U64Set(int32_t v){ return v;}
uint64_t U64SetU(uint32_t v){ return v;}
int U64And(uint64_t v1, uint64_t v2){ return v1 && v2;}
int U64Or(uint64_t v1, uint64_t v2){ return v1 || v2;}
int U64Eor(uint64_t v1, uint64_t v2){ return !!(v1 ^ v2);}
int U64Not(uint64_t v){ return !v;}
int32_t U64Compare(uint64_t l, uint64_t r){ if (l > r) return 1; else if (l < r) return -1; else return 0;}
uint64_t U64BitwiseAnd(uint64_t v1, uint64_t v2){ return v1 & v2;}
uint64_t U64BitwiseOr(uint64_t v1, uint64_t v2){ return v1 | v2;}
uint64_t U64BitwiseEor(uint64_t v1, uint64_t v2){ return v1 ^ v2;}
uint64_t U64BitwiseNor(uint64_t v1){ return ~v1;}
uint64_t U64ShiftRight(uint64_t v, uint32_t shift){ return v >> shift;}
uint64_t U64ShiftLeft(uint64_t v, uint32_t shift){ return v << shift;}
long double U64ToLongDouble(uint64_t v){ return v;}
uint64_t LongDoubleToUInt64(long double v){ return uint64_t(v);}
int64_t UInt64ToSInt64(uint64_t v){ return v;}
uint64_t SInt64ToUInt64(int64_t v){ return v;}