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

Side by Side Diff: client/simple_string_dictionary.cc

Issue 615923004: Convert COMPILE_ASSERT to static_assert (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 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 | « no previous file | crashpad.doxy » ('j') | util/file/file_writer.cc » ('J')
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 "client/simple_string_dictionary.h" 15 #include "client/simple_string_dictionary.h"
16 16
17 #include "base/basictypes.h" 17 #include "base/basictypes.h"
Mark Mentovai 2014/10/01 03:55:12 No longer needed.
scottmg 2014/10/01 16:37:18 Done.
18 #include "util/stdlib/cxx.h" 18 #include "util/stdlib/cxx.h"
19 19
20 #if CXX_LIBRARY_VERSION >= 2011 20 #if CXX_LIBRARY_VERSION >= 2011
21 #include <type_traits> 21 #include <type_traits>
22 #endif 22 #endif
23 23
24 namespace crashpad { 24 namespace crashpad {
25 namespace { 25 namespace {
26 26
27 typedef TSimpleStringDictionary<1, 1, 1> SimpleStringDictionaryForAssertion; 27 typedef TSimpleStringDictionary<1, 1, 1> SimpleStringDictionaryForAssertion;
28 28
29 #if CXX_LIBRARY_VERSION >= 2011 29 #if CXX_LIBRARY_VERSION >= 2011
30 // In C++11, check that TSimpleStringDictionary has standard layout, which is 30 // In C++11, check that TSimpleStringDictionary has standard layout, which is
31 // what is actually important. 31 // what is actually important.
32 COMPILE_ASSERT( 32 static_assert(
33 std::is_standard_layout<SimpleStringDictionaryForAssertion>::value, 33 std::is_standard_layout<SimpleStringDictionaryForAssertion>::value,
34 SimpleStringDictionary_must_be_standard_layout); 34 "SimpleStringDictionary must be standard layout");
35 #else 35 #else
36 // In C++98 (ISO 14882), section 9.5.1 says that a union cannot have a member 36 // In C++98 (ISO 14882), section 9.5.1 says that a union cannot have a member
37 // with a non-trivial ctor, copy ctor, dtor, or assignment operator. Use this 37 // with a non-trivial ctor, copy ctor, dtor, or assignment operator. Use this
38 // property to ensure that Entry remains POD. This doesn’t work for C++11 38 // property to ensure that Entry remains POD. This doesn’t work for C++11
39 // because the requirements for unions have been relaxed. 39 // because the requirements for unions have been relaxed.
40 union Compile_Assert { 40 union Compile_Assert {
41 SimpleStringDictionaryForAssertion::Entry Compile_Assert__entry_must_be_pod; 41 SimpleStringDictionaryForAssertion::Entry Compile_Assert__entry_must_be_pod;
42 }; 42 };
43 #endif 43 #endif
44 44
45 } // namespace 45 } // namespace
46 } // namespace crashpad 46 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | crashpad.doxy » ('j') | util/file/file_writer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698