| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_STRING_UTIL_POSIX_H_ | 5 #ifndef BASE_STRING_UTIL_POSIX_H_ |
| 6 #define BASE_STRING_UTIL_POSIX_H_ | 6 #define BASE_STRING_UTIL_POSIX_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <stdarg.h> | 9 #include <stdarg.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 inline int strncmp16(const char16* s1, const char16* s2, size_t count) { | 38 inline int strncmp16(const char16* s1, const char16* s2, size_t count) { |
| 39 #if defined(WCHAR_T_IS_UTF16) | 39 #if defined(WCHAR_T_IS_UTF16) |
| 40 return ::wcsncmp(s1, s2, count); | 40 return ::wcsncmp(s1, s2, count); |
| 41 #elif defined(WCHAR_T_IS_UTF32) | 41 #elif defined(WCHAR_T_IS_UTF32) |
| 42 return c16memcmp(s1, s2, count); | 42 return c16memcmp(s1, s2, count); |
| 43 #endif | 43 #endif |
| 44 } | 44 } |
| 45 | 45 |
| 46 inline int vswprintf(wchar_t* buffer, size_t size, | 46 inline int vswprintf(wchar_t* buffer, size_t size, |
| 47 const wchar_t* format, va_list arguments) { | 47 const wchar_t* format, va_list arguments) { |
| 48 #if defined(OS_OPENBSD) | |
| 49 // TODO(phajdan.jr): There is a patch to add vswprintf to OpenBSD, | |
| 50 // http://marc.info/?l=openbsd-tech&m=130003157729839&w=2 | |
| 51 NOTIMPLEMENTED(); | |
| 52 return -1; | |
| 53 #else | |
| 54 DCHECK(IsWprintfFormatPortable(format)); | 48 DCHECK(IsWprintfFormatPortable(format)); |
| 55 return ::vswprintf(buffer, size, format, arguments); | 49 return ::vswprintf(buffer, size, format, arguments); |
| 56 #endif | |
| 57 } | 50 } |
| 58 | 51 |
| 59 } // namespace base | 52 } // namespace base |
| 60 | 53 |
| 61 #endif // BASE_STRING_UTIL_POSIX_H_ | 54 #endif // BASE_STRING_UTIL_POSIX_H_ |
| OLD | NEW |