Changeset 2058 for trunk


Ignore:
Timestamp:
Nov 2, 2012, 2:30:19 PM (7 years ago)
Author:
sam
Message:

build: define our own std::abs() function for long long int on NaCl,
since it doesn't exist there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/math/math.h

    r2056 r2058  
    112112static inline int32_t abs(int32_t x) { return std::abs(x); }
    113113static inline uint32_t abs(uint32_t x) { return x; }
     114#if defined __native_client__
     115/* The pepper 19 toolchain doesn't provide abs() for long long int. */
     116static inline int64_t abs(int64_t x) { return x > 0 ? x : -x; }
     117#else
    114118static inline int64_t abs(int64_t x) { return std::abs(x); }
     119#endif
    115120static inline uint64_t abs(uint64_t x) { return x; }
    116121static inline float abs(float x) { return std::abs(x); }
Note: See TracChangeset for help on using the changeset viewer.