| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/logging.h" | 5 #include "base/logging.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <io.h> | 8 #include <io.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 typedef HANDLE FileHandle; | 10 typedef HANDLE FileHandle; |
| 11 typedef HANDLE MutexHandle; | 11 typedef HANDLE MutexHandle; |
| 12 // Windows warns on using write(). It prefers _write(). | 12 // Windows warns on using write(). It prefers _write(). |
| 13 #define write(fd, buf, count) _write(fd, buf, static_cast<unsigned int>(count)) | 13 #define write(fd, buf, count) _write(fd, buf, static_cast<unsigned int>(count)) |
| 14 // Windows doesn't define STDERR_FILENO. Define it here. | 14 // Windows doesn't define STDERR_FILENO. Define it here. |
| 15 #define STDERR_FILENO 2 | 15 #define STDERR_FILENO 2 |
| 16 #elif defined(OS_MACOSX) | 16 #elif defined(OS_MACOSX) |
| 17 #include <CoreFoundation/CoreFoundation.h> | 17 #include <CoreFoundation/CoreFoundation.h> |
| 18 #include <mach/mach.h> | 18 #include <mach/mach.h> |
| 19 #include <mach/mach_time.h> | 19 #include <mach/mach_time.h> |
| 20 #include <mach-o/dyld.h> | 20 #include <mach-o/dyld.h> |
| 21 #elif defined(OS_POSIX) | 21 #elif defined(OS_POSIX) |
| 22 #include <sys/syscall.h> | 22 #include <sys/syscall.h> |
| 23 #include <time.h> | 23 #include <time.h> |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 #if defined(OS_POSIX) | 26 #if defined(OS_POSIX) |
| 27 #include <errno.h> | 27 #include <errno.h> |
| 28 #include <pthread.h> |
| 28 #include <stdlib.h> | 29 #include <stdlib.h> |
| 29 #include <stdio.h> | 30 #include <stdio.h> |
| 30 #include <string.h> | 31 #include <string.h> |
| 31 #include <unistd.h> | 32 #include <unistd.h> |
| 32 #define MAX_PATH PATH_MAX | 33 #define MAX_PATH PATH_MAX |
| 33 typedef FILE* FileHandle; | 34 typedef FILE* FileHandle; |
| 34 typedef pthread_mutex_t* MutexHandle; | 35 typedef pthread_mutex_t* MutexHandle; |
| 35 #endif | 36 #endif |
| 36 | 37 |
| 37 #include <ctime> | 38 #include <ctime> |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 | 725 |
| 725 if (level == LOG_FATAL) | 726 if (level == LOG_FATAL) |
| 726 DebugUtil::BreakDebugger(); | 727 DebugUtil::BreakDebugger(); |
| 727 } | 728 } |
| 728 | 729 |
| 729 } // namespace logging | 730 } // namespace logging |
| 730 | 731 |
| 731 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { | 732 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { |
| 732 return out << WideToUTF8(std::wstring(wstr)); | 733 return out << WideToUTF8(std::wstring(wstr)); |
| 733 } | 734 } |
| OLD | NEW |