Skip to content

Commit

Permalink
[core] Using numeric limits not only with C++11 (#1807)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxsharabayko committed Feb 10, 2021
1 parent f1b35cb commit 66cb7c7
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions srtcore/sync.h
Expand Up @@ -179,21 +179,8 @@ class TimePoint
inline void operator-=(const Duration<Clock>& rhs) { m_timestamp -= rhs.count(); }

public: //
#if HAVE_FULL_CXX11
static inline ATR_CONSTEXPR TimePoint min() { return TimePoint(numeric_limits<uint64_t>::min()); }
static inline ATR_CONSTEXPR TimePoint max() { return TimePoint(numeric_limits<uint64_t>::max()); }
#else
#ifndef UINT64_MAX
#define UNDEF_UINT64_MAX
#define UINT64_MAX 0xffffffffffffffffULL
#endif
static inline TimePoint min() { return TimePoint(0); }
static inline TimePoint max() { return TimePoint(UINT64_MAX); }

#ifdef UNDEF_UINT64_MAX
#undef UINT64_MAX
#endif
#endif

public:
Duration<Clock> time_since_epoch() const;
Expand Down

0 comments on commit 66cb7c7

Please sign in to comment.