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

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

Issue 1117013006: Pull string_util for posix too (Closed) Base URL: https://chromium.googlesource.com/chromium/mini_chromium@master
Patch Set: . 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/strings/string_util_posix.h ('k') | no next file » | 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 #ifndef BASE_STRINGS_STRING_UTIL_WIN_H_ 5 #ifndef BASE_STRINGS_STRING_UTIL_WIN_H_
6 #define BASE_STRINGS_STRING_UTIL_WIN_H_ 6 #define BASE_STRINGS_STRING_UTIL_WIN_H_
7 7
8 #include <stdio.h>
9 #include <string.h> 8 #include <string.h>
10 #include <wchar.h>
11
12 #include "base/strings/string16.h"
13 9
14 namespace base { 10 namespace base {
15 11
16 // Chromium code style is to not use malloc'd strings; this is only for use 12 // Chromium code style is to not use malloc'd strings; this is only for use
17 // for interaction with APIs that require it. 13 // for interaction with APIs that require it.
18 inline char* strdup(const char* str) { 14 inline char* strdup(const char* str) {
19 return _strdup(str); 15 return _strdup(str);
20 } 16 }
21 17
22 inline int strcasecmp(const char* s1, const char* s2) { 18 inline int strcasecmp(const char* s1, const char* s2) {
23 return _stricmp(s1, s2); 19 return _stricmp(s1, s2);
24 } 20 }
25 21
26 inline int strncasecmp(const char* s1, const char* s2, size_t count) { 22 inline int strncasecmp(const char* s1, const char* s2, size_t count) {
27 return _strnicmp(s1, s2, count); 23 return _strnicmp(s1, s2, count);
28 } 24 }
29 25
30 inline int strncmp16(const char16* s1, const char16* s2, size_t count) {
31 return wcsncmp(s1, s2, count);
32 }
33
34 } // namespace base 26 } // namespace base
35 27
36 #endif // BASE_STRINGS_STRING_UTIL_WIN_H_ 28 #endif // BASE_STRINGS_STRING_UTIL_WIN_H_
OLDNEW
« no previous file with comments | « base/strings/string_util_posix.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698