-// -*- mode: c++; c-basic-offset: 4 -*-
/*
* Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2009 Torch Mobile, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include <CoreFoundation/CFString.h>
-#if COMPILER(MSVC)
+#if COMPILER(MSVC) && !OS(WINCE)
#ifndef WINVER
#define WINVER 0x0500
#endif
#include <crtdbg.h>
#endif
+#if OS(WINCE)
+#include <winbase.h>
+#endif
+
extern "C" {
WTF_ATTRIBUTE_PRINTF(1, 0)
if (strstr(format, "%@")) {
CFStringRef cfFormat = CFStringCreateWithCString(NULL, format, kCFStringEncodingUTF8);
CFStringRef str = CFStringCreateWithFormatAndArguments(NULL, NULL, cfFormat, args);
-
+
int length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(str), kCFStringEncodingUTF8);
char* buffer = (char*)malloc(length + 1);
CFRelease(str);
CFRelease(cfFormat);
} else
+#if OS(SYMBIAN)
+ vfprintf(stdout, format, args);
+#else
vfprintf(stderr, format, args);
+#endif
}
WTF_ATTRIBUTE_PRINTF(1, 2)
static void printCallSite(const char* file, int line, const char* function)
{
-#if PLATFORM(WIN) && defined _DEBUG
+#if OS(WIN) && !OS(WINCE) && defined _DEBUG
_CrtDbgReport(_CRT_WARN, file, line, NULL, "%s\n", function);
#else
printf_stderr_common("(%s:%d %s)\n", file, line, function);