diff options
author | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-04-03 14:26:10 +0000 |
---|---|---|
committer | reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2009-04-03 14:26:10 +0000 |
commit | 9c970453fd1cb6e9618e37c61507465772deca80 (patch) | |
tree | 5dfbc59e5cfd9283bf5e6b10b640fa28ea95326b /src/ports/SkDebug_stdio.cpp | |
parent | 41bccf55b56d75ab0c0b3726dd64baba80ba7e90 (diff) |
import portability fixes from Chrome around floats
move porting functions for SkDebugf into /ports directory
git-svn-id: http://skia.googlecode.com/svn/trunk@147 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports/SkDebug_stdio.cpp')
-rw-r--r-- | src/ports/SkDebug_stdio.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ports/SkDebug_stdio.cpp b/src/ports/SkDebug_stdio.cpp new file mode 100644 index 0000000000..f5bf687644 --- /dev/null +++ b/src/ports/SkDebug_stdio.cpp @@ -0,0 +1,33 @@ +/* libs/corecg/SkDebug_stdio.cpp +** +** Copyright 2006, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +#include "SkTypes.h" + +static const size_t kBufferSize = 256; + +#include <stdarg.h> +#include <stdio.h> + +void SkDebugf(const char format[], ...) { + char buffer[kBufferSize + 1]; + va_list args; + va_start(args, format); + vsnprintf(buffer, kBufferSize, format, args); + va_end(args); + fprintf(stderr, buffer); +} + |