OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
| 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. |
| 14 |
| 15 #ifndef CRASHPAD_UTIL_NUMERIC_INT128_H_ |
| 16 #define CRASHPAD_UTIL_NUMERIC_INT128_H_ |
| 17 |
| 18 #include <stdint.h> |
| 19 |
| 20 #include "build/build_config.h" |
| 21 |
| 22 namespace crashpad { |
| 23 |
| 24 //! \brief Stores a 128-bit quantity. |
| 25 //! |
| 26 //! This structure is organized so that 128-bit quantities are laid out in |
| 27 //! memory according to the system’s natural byte order. If a system offers a |
| 28 //! native 128-bit type, it should be possible to bit_cast<> between that type |
| 29 //! and this one. |
| 30 //! |
| 31 //! This structure is designed to have the same layout, although not the same |
| 32 //! field names, as the Windows SDK’s `M128A` type from `<winnt.h>`. It is |
| 33 //! provided here instead of in `compat` because it is useful outside of the |
| 34 //! scope of data structures defined by the Windows SDK. |
| 35 struct uint128_struct { |
| 36 #if defined(ARCH_CPU_LITTLE_ENDIAN) || DOXYGEN |
| 37 //! \brief The low 64 bits of the 128-bit quantity. |
| 38 uint64_t lo; |
| 39 |
| 40 //! \brief The high 64 bits of the 128-bit quantity. |
| 41 uint64_t hi; |
| 42 #else |
| 43 uint64_t hi; |
| 44 uint64_t lo; |
| 45 #endif |
| 46 }; |
| 47 |
| 48 } // namespace crashpad |
| 49 |
| 50 #endif // CRASHPAD_UTIL_NUMERIC_INT128_H_ |
OLD | NEW |