tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Version.inc (1313B)


      1 //
      2 // Copyright 2015 The ANGLE Project Authors. All rights reserved.
      3 // Use of this source code is governed by a BSD-style license that can be
      4 // found in the LICENSE file.
      5 //
      6 
      7 // Version.inc: Encapsulation of a GL version.
      8 
      9 #include <tuple>
     10 
     11 namespace gl
     12 {
     13 
     14 constexpr Version::Version()
     15    : Version(0, 0)
     16 {
     17 }
     18 
     19 // Avoid conflicts with linux system defines
     20 #undef major
     21 #undef minor
     22 
     23 constexpr Version::Version(unsigned int major_, unsigned int minor_)
     24    : major(major_),
     25      minor(minor_)
     26 {
     27 }
     28 
     29 inline bool operator==(const Version &a, const Version &b)
     30 {
     31    return std::tie(a.major, a.minor) == std::tie(b.major, b.minor);
     32 }
     33 
     34 inline bool operator!=(const Version &a, const Version &b)
     35 {
     36    return std::tie(a.major, a.minor) != std::tie(b.major, b.minor);
     37 }
     38 
     39 inline bool operator>=(const Version &a, const Version &b)
     40 {
     41    return std::tie(a.major, a.minor) >= std::tie(b.major, b.minor);
     42 }
     43 
     44 inline bool operator<=(const Version &a, const Version &b)
     45 {
     46    return std::tie(a.major, a.minor) <= std::tie(b.major, b.minor);
     47 }
     48 
     49 inline bool operator<(const Version &a, const Version &b)
     50 {
     51    return std::tie(a.major, a.minor) < std::tie(b.major, b.minor);
     52 }
     53 
     54 inline bool operator>(const Version &a, const Version &b)
     55 {
     56    return std::tie(a.major, a.minor) > std::tie(b.major, b.minor);
     57 }
     58 
     59 }  // namespace gl