chromium/third_party/protobuf/src/google/protobuf/stubs/int128.h

// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.  All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
//     * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//     * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_STUBS_INT128_H_
#define GOOGLE_PROTOBUF_STUBS_INT128_H_

#include <google/protobuf/stubs/common.h>

#include <iosfwd>

#include <google/protobuf/port_def.inc>

namespace google {
namespace protobuf {

struct uint128_pod;

// TODO(xiaofeng): Define GOOGLE_PROTOBUF_HAS_CONSTEXPR when constexpr is
// available.
#ifdef GOOGLE_PROTOBUF_HAS_CONSTEXPR
#define UINT128_CONSTEXPR
#else
#define UINT128_CONSTEXPR
#endif

// An unsigned 128-bit integer type. Thread-compatible.
class PROTOBUF_EXPORT uint128 {};

// This is a POD form of uint128 which can be used for static variables which
// need to be operated on as uint128.
struct uint128_pod {};

PROTOBUF_EXPORT extern const uint128_pod kuint128max;

// allow uint128 to be logged
PROTOBUF_EXPORT extern std::ostream& operator<<(std::ostream& o,
                                                const uint128& b);

// Methods to access low and high pieces of 128-bit value.
// Defined externally from uint128 to facilitate conversion
// to native 128-bit types when compilers support them.
inline uint64_t Uint128Low64(const uint128& v) {}
inline uint64_t Uint128High64(const uint128& v) {}

// TODO: perhaps it would be nice to have int128, a signed 128-bit type?

// --------------------------------------------------------------------------
//                      Implementation details follow
// --------------------------------------------------------------------------
inline bool operator==(const uint128& lhs, const uint128& rhs) {}
inline bool operator!=(const uint128& lhs, const uint128& rhs) {}

inline UINT128_CONSTEXPR uint128::uint128() :{}
inline UINT128_CONSTEXPR uint128::uint128(uint64_t top, uint64_t bottom)
    :{}
inline UINT128_CONSTEXPR uint128::uint128(const uint128_pod& v)
    :{}
inline UINT128_CONSTEXPR uint128::uint128(uint64_t bottom)
    :{}
#ifndef SWIG
inline UINT128_CONSTEXPR uint128::uint128(uint32_t bottom)
    :{}
inline UINT128_CONSTEXPR uint128::uint128(int bottom)
    :{}
#endif

#undef UINT128_CONSTEXPR

inline void uint128::Initialize(uint64_t top, uint64_t bottom) {}

// Comparison operators.

#define CMP128

CMP128
CMP128
CMP128
CMP128

#undef CMP128

// Unary operators

inline uint128 operator-(const uint128& val) {}

inline bool operator!(const uint128& val) {}

// Logical operators.

inline uint128 operator~(const uint128& val) {}

#define LOGIC128

LOGIC128
LOGIC128
LOGIC128

#undef LOGIC128

#define LOGICASSIGN128

LOGICASSIGN128
LOGICASSIGN128
LOGICASSIGN128

#undef LOGICASSIGN128

// Shift operators.

inline uint128 operator<<(const uint128& val, int amount) {}

inline uint128 operator>>(const uint128& val, int amount) {}

inline uint128& uint128::operator<<=(int amount) {}

inline uint128& uint128::operator>>=(int amount) {}

inline uint128 operator+(const uint128& lhs, const uint128& rhs) {}

inline uint128 operator-(const uint128& lhs, const uint128& rhs) {}

inline uint128 operator*(const uint128& lhs, const uint128& rhs) {}

inline uint128 operator/(const uint128& lhs, const uint128& rhs) {}

inline uint128 operator%(const uint128& lhs, const uint128& rhs) {}

inline uint128& uint128::operator+=(const uint128& b) {}

inline uint128& uint128::operator-=(const uint128& b) {}

inline uint128& uint128::operator*=(const uint128& b) {}

inline uint128 uint128::operator++(int) {}

inline uint128 uint128::operator--(int) {}

inline uint128& uint128::operator++() {}

inline uint128& uint128::operator--() {}

}  // namespace protobuf
}  // namespace google

#include <google/protobuf/port_undef.inc>

#endif  // GOOGLE_PROTOBUF_STUBS_INT128_H_