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 #include "util/misc/uuid.h" | 15 #include "util/misc/uuid.h" |
16 | 16 |
17 #include <string.h> | 17 #include <string.h> |
18 | 18 |
19 #include "base/basictypes.h" | 19 #include "base/basictypes.h" |
20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
21 #include "base/sys_byteorder.h" | 21 #include "base/sys_byteorder.h" |
22 #include "util/stdlib/cxx.h" | 22 #include "util/stdlib/cxx.h" |
23 | 23 |
24 #if CXX_LIBRARY_VERSION >= 2011 | 24 #if CXX_LIBRARY_VERSION >= 2011 |
25 #include <type_traits> | 25 #include <type_traits> |
26 #endif | 26 #endif |
27 | 27 |
28 namespace crashpad { | 28 namespace crashpad { |
29 | 29 |
30 COMPILE_ASSERT(sizeof(UUID) == 16, UUID_must_be_16_bytes); | 30 static_assert(sizeof(UUID) == 16, "UUID must be 16 bytes"); |
31 | 31 |
32 #if CXX_LIBRARY_VERSION >= 2011 | 32 #if CXX_LIBRARY_VERSION >= 2011 |
33 COMPILE_ASSERT(std::is_standard_layout<UUID>::value, | 33 static_assert(std::is_standard_layout<UUID>::value, |
34 UUID_must_be_standard_layout); | 34 "UUID must be standard layout"); |
35 #endif | 35 #endif |
36 | 36 |
37 UUID::UUID() : data_1(0), data_2(0), data_3(0), data_4(), data_5() { | 37 UUID::UUID() : data_1(0), data_2(0), data_3(0), data_4(), data_5() { |
38 } | 38 } |
39 | 39 |
40 UUID::UUID(const uint8_t* bytes) { | 40 UUID::UUID(const uint8_t* bytes) { |
41 InitializeFromBytes(bytes); | 41 InitializeFromBytes(bytes); |
42 } | 42 } |
43 | 43 |
44 bool UUID::operator==(const UUID& that) const { | 44 bool UUID::operator==(const UUID& that) const { |
(...skipping 16 matching lines...) Expand all Loading... |
61 data_4[1], | 61 data_4[1], |
62 data_5[0], | 62 data_5[0], |
63 data_5[1], | 63 data_5[1], |
64 data_5[2], | 64 data_5[2], |
65 data_5[3], | 65 data_5[3], |
66 data_5[4], | 66 data_5[4], |
67 data_5[5]); | 67 data_5[5]); |
68 } | 68 } |
69 | 69 |
70 } // namespace crashpad | 70 } // namespace crashpad |
OLD | NEW |