diff options
Diffstat (limited to 'libs/corecg/SkDebug_stdio.cpp')
-rw-r--r-- | libs/corecg/SkDebug_stdio.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/corecg/SkDebug_stdio.cpp b/libs/corecg/SkDebug_stdio.cpp new file mode 100644 index 0000000000..6a35857052 --- /dev/null +++ b/libs/corecg/SkDebug_stdio.cpp @@ -0,0 +1,21 @@ +#include "SkTypes.h" + +#if (defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX)) && defined(SK_DEBUG) + +#include <stdarg.h> +#include <stdio.h> + +void SkDebugf(const char format[], ...) +{ + static const size_t kBufferSize = 256; + + char buffer[kBufferSize + 1]; + va_list args; + va_start(args, format); + vsnprintf(buffer, kBufferSize, format, args); + va_end(args); + fprintf(stderr, buffer); +} + +#endif + |