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

Side by Side Diff: src/platform-posix.cc

Issue 6672041: Add a preprocessor symbol to have printing on Android use stdout instead of t... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 void OS::Print(const char* format, ...) { 133 void OS::Print(const char* format, ...) {
134 va_list args; 134 va_list args;
135 va_start(args, format); 135 va_start(args, format);
136 VPrint(format, args); 136 VPrint(format, args);
137 va_end(args); 137 va_end(args);
138 } 138 }
139 139
140 140
141 void OS::VPrint(const char* format, va_list args) { 141 void OS::VPrint(const char* format, va_list args) {
142 #if defined(ANDROID) 142 #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
143 LOG_PRI_VA(ANDROID_LOG_INFO, LOG_TAG, format, args); 143 LOG_PRI_VA(ANDROID_LOG_INFO, LOG_TAG, format, args);
144 #else 144 #else
145 vprintf(format, args); 145 vprintf(format, args);
146 #endif 146 #endif
147 } 147 }
148 148
149 149
150 void OS::FPrint(FILE* out, const char* format, ...) { 150 void OS::FPrint(FILE* out, const char* format, ...) {
151 va_list args; 151 va_list args;
152 va_start(args, format); 152 va_start(args, format);
153 VFPrint(out, format, args); 153 VFPrint(out, format, args);
154 va_end(args); 154 va_end(args);
155 } 155 }
156 156
157 157
158 void OS::VFPrint(FILE* out, const char* format, va_list args) { 158 void OS::VFPrint(FILE* out, const char* format, va_list args) {
159 #if defined(ANDROID) 159 #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
160 LOG_PRI_VA(ANDROID_LOG_INFO, LOG_TAG, format, args); 160 LOG_PRI_VA(ANDROID_LOG_INFO, LOG_TAG, format, args);
161 #else 161 #else
162 vfprintf(out, format, args); 162 vfprintf(out, format, args);
163 #endif 163 #endif
164 } 164 }
165 165
166 166
167 void OS::PrintError(const char* format, ...) { 167 void OS::PrintError(const char* format, ...) {
168 va_list args; 168 va_list args;
169 va_start(args, format); 169 va_start(args, format);
170 VPrintError(format, args); 170 VPrintError(format, args);
171 va_end(args); 171 va_end(args);
172 } 172 }
173 173
174 174
175 void OS::VPrintError(const char* format, va_list args) { 175 void OS::VPrintError(const char* format, va_list args) {
176 #if defined(ANDROID) 176 #if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
177 LOG_PRI_VA(ANDROID_LOG_ERROR, LOG_TAG, format, args); 177 LOG_PRI_VA(ANDROID_LOG_ERROR, LOG_TAG, format, args);
178 #else 178 #else
179 vfprintf(stderr, format, args); 179 vfprintf(stderr, format, args);
180 #endif 180 #endif
181 } 181 }
182 182
183 183
184 int OS::SNPrintF(Vector<char> str, const char* format, ...) { 184 int OS::SNPrintF(Vector<char> str, const char* format, ...) {
185 va_list args; 185 va_list args;
186 va_start(args, format); 186 va_start(args, format);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return ntohl(value); 390 return ntohl(value);
391 } 391 }
392 392
393 393
394 Socket* OS::CreateSocket() { 394 Socket* OS::CreateSocket() {
395 return new POSIXSocket(); 395 return new POSIXSocket();
396 } 396 }
397 397
398 398
399 } } // namespace v8::internal 399 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698