OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/basictypes.h" |
5 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "build/build_config.h" |
6 | 8 |
7 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
8 #include <io.h> | 10 #include <io.h> |
9 #include <windows.h> | 11 #include <windows.h> |
| 12 |
10 typedef HANDLE FileHandle; | 13 typedef HANDLE FileHandle; |
11 typedef HANDLE MutexHandle; | 14 typedef HANDLE MutexHandle; |
12 // Windows warns on using write(). It prefers _write(). | 15 // Windows warns on using write(). It prefers _write(). |
13 #define write(fd, buf, count) _write(fd, buf, static_cast<unsigned int>(count)) | 16 #define write(fd, buf, count) _write(fd, buf, static_cast<unsigned int>(count)) |
14 // Windows doesn't define STDERR_FILENO. Define it here. | 17 // Windows doesn't define STDERR_FILENO. Define it here. |
15 #define STDERR_FILENO 2 | 18 #define STDERR_FILENO 2 |
16 #elif defined(OS_MACOSX) | 19 #elif defined(OS_MACOSX) |
17 #include <CoreFoundation/CoreFoundation.h> | |
18 #include <mach/mach.h> | |
19 #include <mach/mach_time.h> | 20 #include <mach/mach_time.h> |
20 #include <mach-o/dyld.h> | |
21 #elif defined(OS_POSIX) | 21 #elif defined(OS_POSIX) |
22 #if defined(OS_NACL) | 22 #if defined(OS_NACL) |
23 #include <sys/nacl_syscalls.h> | 23 #include <sys/nacl_syscalls.h> |
24 #include <sys/time.h> // timespec doesn't seem to be in <time.h> | 24 #include <sys/time.h> // timespec doesn't seem to be in <time.h> |
25 #else | 25 #else |
26 #include <sys/syscall.h> | 26 #include <sys/syscall.h> |
27 #endif | 27 #endif |
28 #include <time.h> | 28 #include <time.h> |
29 #endif | 29 #endif |
30 | 30 |
31 #if defined(OS_POSIX) | 31 #if defined(OS_POSIX) |
32 #include <errno.h> | |
33 #include <pthread.h> | 32 #include <pthread.h> |
34 #include <stdlib.h> | |
35 #include <stdio.h> | 33 #include <stdio.h> |
36 #include <string.h> | 34 #include <string.h> |
37 #include <unistd.h> | 35 #include <unistd.h> |
| 36 |
38 #define MAX_PATH PATH_MAX | 37 #define MAX_PATH PATH_MAX |
39 typedef FILE* FileHandle; | 38 typedef FILE* FileHandle; |
40 typedef pthread_mutex_t* MutexHandle; | 39 typedef pthread_mutex_t* MutexHandle; |
41 #endif | 40 #endif |
42 | 41 |
| 42 #include </Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreFoundatio
n.framework/Headers/CFBase.h> |
| 43 #include </Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreFoundatio
n.framework/Headers/CFString.h> |
| 44 #include </Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreFoundatio
n.framework/Headers/CFUserNotification.h> |
| 45 #include <mach/mach_init.h> |
| 46 #include <stdbool.h> |
| 47 #include <stddef.h> |
| 48 #include <sys/errno.h> |
| 49 #include <sys/syslimits.h> |
| 50 #include <algorithm> |
43 #include <ctime> | 51 #include <ctime> |
44 #include <iomanip> | 52 #include <iomanip> |
45 #include <cstring> | 53 #include <ostream> |
46 #include <algorithm> | 54 #include <sstream> |
| 55 #include <string> |
47 | 56 |
48 #include "base/base_switches.h" | 57 #include "base/base_switches.h" |
49 #include "base/command_line.h" | 58 #include "base/command_line.h" |
50 #include "base/debug/debugger.h" | 59 #include "base/debug/debugger.h" |
51 #include "base/debug/stack_trace.h" | 60 #include "base/debug/stack_trace.h" |
52 #include "base/eintr_wrapper.h" | 61 #include "base/eintr_wrapper.h" |
53 #include "base/string_piece.h" | 62 #include "base/string_piece.h" |
54 #include "base/synchronization/lock_impl.h" | 63 #include "base/synchronization/lock_impl.h" |
55 #include "base/utf_string_conversions.h" | 64 #include "base/utf_string_conversions.h" |
56 #include "base/vlog.h" | 65 #include "base/vlog.h" |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 | 826 |
818 if (level == LOG_FATAL) | 827 if (level == LOG_FATAL) |
819 base::debug::BreakDebugger(); | 828 base::debug::BreakDebugger(); |
820 } | 829 } |
821 | 830 |
822 } // namespace logging | 831 } // namespace logging |
823 | 832 |
824 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { | 833 std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { |
825 return out << WideToUTF8(std::wstring(wstr)); | 834 return out << WideToUTF8(std::wstring(wstr)); |
826 } | 835 } |
OLD | NEW |