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

Side by Side Diff: base/strings/safe_sprintf.cc

Issue 1446363003: Deleted OS_WIN and all Windows specific files from base. (Closed) Base URL: https://github.com/domokit/mojo.git@base_tests
Patch Set: Created 5 years, 1 month 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 | « base/sha1_win.cc ('k') | base/strings/string_util.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/strings/safe_sprintf.h" 5 #include "base/strings/safe_sprintf.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #if !defined(NDEBUG) 9 #if !defined(NDEBUG)
10 // In debug builds, we use RAW_CHECK() to print useful error messages, if 10 // In debug builds, we use RAW_CHECK() to print useful error messages, if
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 size_(size - 1), // Account for trailing NUL byte 108 size_(size - 1), // Account for trailing NUL byte
109 count_(0) { 109 count_(0) {
110 // The following assertion does not build on Mac and Android. This is because 110 // The following assertion does not build on Mac and Android. This is because
111 // static_assert only works with compile-time constants, but mac uses 111 // static_assert only works with compile-time constants, but mac uses
112 // libstdc++4.2 and android uses stlport, which both don't mark 112 // libstdc++4.2 and android uses stlport, which both don't mark
113 // numeric_limits::max() as constexp. Likewise, MSVS2013's standard library 113 // numeric_limits::max() as constexp. Likewise, MSVS2013's standard library
114 // also doesn't mark max() as constexpr yet. cl.exe supports static_cast but 114 // also doesn't mark max() as constexpr yet. cl.exe supports static_cast but
115 // doesn't really implement constexpr yet so it doesn't complain, but clang 115 // doesn't really implement constexpr yet so it doesn't complain, but clang
116 // does. 116 // does.
117 #if __cplusplus >= 201103 && !defined(OS_ANDROID) && !defined(OS_MACOSX) && \ 117 #if __cplusplus >= 201103 && !defined(OS_ANDROID) && !defined(OS_MACOSX) && \
118 !defined(OS_IOS) && !(defined(__clang__) && defined(OS_WIN)) 118 !defined(OS_IOS) && !(defined(__clang__))
119 COMPILE_ASSERT(kSSizeMaxConst == \ 119 COMPILE_ASSERT(kSSizeMaxConst == \
120 static_cast<size_t>(std::numeric_limits<ssize_t>::max()), 120 static_cast<size_t>(std::numeric_limits<ssize_t>::max()),
121 kSSizeMax_is_the_max_value_of_an_ssize_t); 121 kSSizeMax_is_the_max_value_of_an_ssize_t);
122 #endif 122 #endif
123 DEBUG_CHECK(size > 0); 123 DEBUG_CHECK(size > 0);
124 DEBUG_CHECK(size <= kSSizeMax); 124 DEBUG_CHECK(size <= kSSizeMax);
125 } 125 }
126 126
127 ~Buffer() { 127 ~Buffer() {
128 // The code calling the constructor guaranteed that there was enough space 128 // The code calling the constructor guaranteed that there was enough space
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 DEBUG_CHECK(src[0] != '%' || src[1] == '%'); 676 DEBUG_CHECK(src[0] != '%' || src[1] == '%');
677 if (src[0] == '%' && src[1] == '%') { 677 if (src[0] == '%' && src[1] == '%') {
678 ++src; 678 ++src;
679 } 679 }
680 } 680 }
681 return buffer.GetCount(); 681 return buffer.GetCount();
682 } 682 }
683 683
684 } // namespace strings 684 } // namespace strings
685 } // namespace base 685 } // namespace base
OLDNEW
« no previous file with comments | « base/sha1_win.cc ('k') | base/strings/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698