Skip to content

Commit f6ec67d

Browse files
authored
Merge pull request #1097 from brechtvl/fix-ptols-size
Fix build error using ParticlesToLevelSet without attribute
2 parents 73de06e + d74f5dd commit f6ec67d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

openvdb/openvdb/math/Math.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,11 @@ inline long double Abs(long double x) { return std::fabs(x); }
319319
inline uint32_t Abs(uint32_t i) { return i; }
320320
inline uint64_t Abs(uint64_t i) { return i; }
321321
inline bool Abs(bool b) { return b; }
322-
// On OSX size_t and uint64_t are different types
323-
#if defined(__APPLE__) || defined(MACOSX)
324-
inline size_t Abs(size_t i) { return i; }
325-
#endif
322+
// On systems like macOS and FreeBSD, size_t and uint64_t are different types
323+
template <typename T, typename std::enable_if<
324+
std::is_same<T, size_t>::value
325+
>::type* = nullptr>
326+
inline T Abs(T i) { return i; }
326327
//@}
327328

328329

0 commit comments

Comments
 (0)