diff options
author | Ben Murdoch <benm@google.com> | 2011-05-05 13:52:32 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-10 15:41:47 +0100 |
commit | b0fe1620dcb4135ac3ab2d66ff93072373911299 (patch) | |
tree | 3487cdc7e01ec56a6f84ea20f4bae596a0b73986 /src/v8utils.h | |
parent | df5bff59602802b769e994b0dc1d8869a27fa40c (diff) | |
download | android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.tar.gz android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.tar.bz2 android_external_v8-b0fe1620dcb4135ac3ab2d66ff93072373911299.zip |
Update V8 to r6101 as required by WebKit r74534
Change-Id: I7f84af8dd732f11898fd644b2c2b1538914cb78d
Diffstat (limited to 'src/v8utils.h')
-rw-r--r-- | src/v8utils.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/v8utils.h b/src/v8utils.h index a907c9f5..87efbcfe 100644 --- a/src/v8utils.h +++ b/src/v8utils.h @@ -29,6 +29,10 @@ #define V8_V8UTILS_H_ #include "utils.h" +#ifdef ANDROID +// Cherry pick from r6346 to build on Android. +#include "platform.h" +#endif namespace v8 { namespace internal { @@ -42,18 +46,26 @@ namespace internal { // so it works on MacOSX. #if defined(__MACH__) && defined(__APPLE__) #define PRINTF_CHECKING +#define FPRINTF_CHECKING #else // MacOsX. #define PRINTF_CHECKING __attribute__ ((format (printf, 1, 2))) +#define FPRINTF_CHECKING __attribute__ ((format (printf, 2, 3))) #endif #else #define PRINTF_CHECKING +#define FPRINTF_CHECKING #endif // Our version of printf(). void PRINTF_CHECKING PrintF(const char* format, ...); +void FPRINTF_CHECKING PrintF(FILE* out, const char* format, ...); // Our version of fflush. -void Flush(); +void Flush(FILE* out); + +inline void Flush() { + Flush(stdout); +} // Read a line of characters after printing the prompt to stdout. The resulting @@ -67,6 +79,14 @@ char* ReadLine(const char* prompt); byte* ReadBytes(const char* filename, int* size, bool verbose = true); +// Append size chars from str to the file given by filename. +// The file is overwritten. Returns the number of chars written. +int AppendChars(const char* filename, + const char* str, + int size, + bool verbose = true); + + // Write size chars from str to the file given by filename. // The file is overwritten. Returns the number of chars written. int WriteChars(const char* filename, @@ -217,6 +237,9 @@ class StringBuilder { // Add formatted contents to the builder just like printf(). void AddFormatted(const char* format, ...); + // Add formatted contents like printf based on a va_list. + void AddFormattedList(const char* format, va_list list); + // Add character padding to the builder. If count is non-positive, // nothing is added to the builder. void AddPadding(char c, int count); |