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

Side by Side Diff: base/strings/string_util.h

Issue 1119173003: win: pull in string_util_win.h from Chromium for strcasecmp (Closed) Base URL: https://chromium.googlesource.com/chromium/mini_chromium@master
Patch Set: cleanup Created 5 years, 7 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 | « base/base.gyp ('k') | base/strings/string_util_win.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 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright 2006-2008 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 #ifndef MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_H_ 5 #ifndef MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_H_
6 #define MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_H_ 6 #define MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace base { 11 namespace base {
12 12
13 int vsnprintf(char* buffer, size_t size, const char* format, va_list arguments) 13 int vsnprintf(char* buffer, size_t size, const char* format, va_list arguments)
14 PRINTF_FORMAT(3, 0); 14 PRINTF_FORMAT(3, 0);
15 15
16 } // namespace base 16 } // namespace base
17 17
18 #if defined(OS_POSIX) 18 #if defined(OS_WIN)
19 #include "base/strings/string_util_win.h"
20 #elif defined(OS_POSIX)
19 #include "base/strings/string_util_posix.h" 21 #include "base/strings/string_util_posix.h"
20 #endif 22 #endif
21 23
22 template <class string_type> 24 template <class string_type>
23 inline typename string_type::value_type* WriteInto(string_type* str, 25 inline typename string_type::value_type* WriteInto(string_type* str,
24 size_t length_with_null) { 26 size_t length_with_null) {
25 DCHECK_NE(0u, length_with_null); 27 DCHECK_NE(0u, length_with_null);
26 str->reserve(length_with_null); 28 str->reserve(length_with_null);
27 str->resize(length_with_null - 1); 29 str->resize(length_with_null - 1);
28 30
29 if (length_with_null <= 1) 31 if (length_with_null <= 1)
30 return NULL; 32 return NULL;
31 33
32 return &((*str)[0]); 34 return &((*str)[0]);
33 } 35 }
34 36
35 #endif // MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_H_ 37 #endif // MINI_CHROMIUM_BASE_STRINGS_STRING_UTIL_H_
OLDNEW
« no previous file with comments | « base/base.gyp ('k') | base/strings/string_util_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698