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