Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: util/misc/uuid.cc

Issue 615923004: Convert COMPILE_ASSERT to static_assert (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: fixes Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « util/mach/symbolic_constants_mach.cc ('k') | util/numeric/checked_range.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « util/mach/symbolic_constants_mach.cc ('k') | util/numeric/checked_range.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698