summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>2010-06-11 02:04:36 +0200
committerRalf Habacker <ralf.habacker@freenet.de>2010-07-19 10:32:08 +0200
commit2313832d3880ae17edc0629f981d4ec0980e4def (patch)
treebb27f6187416f37ecf691329e1b65fb1fde72f03
parent821f99c318bab33855ce95097447363fa62b163e (diff)
downloaddbus-2313832d3880ae17edc0629f981d4ec0980e4def.tar.gz
Wrap OutputDebugString for Windows CE builds, and add cast for MSVC.
-rw-r--r--dbus/dbus-internals.c2
-rw-r--r--dbus/dbus-sysdeps-util-win.c2
-rw-r--r--dbus/dbus-sysdeps-wince-glue.c21
-rw-r--r--dbus/dbus-sysdeps-wince-glue.h4
4 files changed, 26 insertions, 3 deletions
diff --git a/dbus/dbus-internals.c b/dbus/dbus-internals.c
index 1ab6731a..2ed56b35 100644
--- a/dbus/dbus-internals.c
+++ b/dbus/dbus-internals.c
@@ -443,7 +443,7 @@ _dbus_verbose_real (const char *format,
#endif
vsprintf (buf+strlen(buf),format, args);
va_end (args);
- OutputDebugString(buf);
+ OutputDebugStringA(buf);
}
#else
#ifdef DBUS_CPP_SUPPORTS_VARIABLE_MACRO_ARGUMENTS
diff --git a/dbus/dbus-sysdeps-util-win.c b/dbus/dbus-sysdeps-util-win.c
index 6c101e7d..2f214092 100644
--- a/dbus/dbus-sysdeps-util-win.c
+++ b/dbus/dbus-sysdeps-util-win.c
@@ -307,7 +307,7 @@ _dbus_system_logv (DBusSystemLogSeverity severity, const char *msg, va_list args
sprintf(buf,"%s%s",s,msg);
vsprintf(buf,buf,args);
- OutputDebugString(buf);
+ OutputDebugStringA(buf);
if (severity == DBUS_SYSTEM_LOG_FATAL)
exit (1);
diff --git a/dbus/dbus-sysdeps-wince-glue.c b/dbus/dbus-sysdeps-wince-glue.c
index 3eaeadab..74b1371f 100644
--- a/dbus/dbus-sysdeps-wince-glue.c
+++ b/dbus/dbus-sysdeps-wince-glue.c
@@ -89,7 +89,7 @@ get_verbose_setting()
RegCloseKey (key_handle);
return NULL;
}
- if (RegQueryValueExW (key_handle, name, 0, &type, result_w, &nbytes))
+ if (RegQueryValueExW (key_handle, name, 0, &type, (LPBYTE) result_w, &nbytes))
{
RegCloseKey (key_handle);
free (result_w);
@@ -1144,3 +1144,22 @@ SHGetSpecialFolderPathA (HWND hwndOwner, LPSTR lpszPath, int nFolder,
lpszPath[MAX_PATH - 1] = '\0';
return result;
}
+
+
+void
+OutputDebugStringA (LPCSTR lpOutputString)
+{
+ wchar_t *str;
+ HANDLE result;
+ int err;
+
+ str = _dbus_win_utf8_to_utf16 (lpOutputString, NULL);
+ if (!str)
+ return;
+
+ OutputDebugStringW (str);
+
+ err = GetLastError ();
+ dbus_free (str);
+ SetLastError (err);
+}
diff --git a/dbus/dbus-sysdeps-wince-glue.h b/dbus/dbus-sysdeps-wince-glue.h
index 7a6462b2..f5ac6c8a 100644
--- a/dbus/dbus-sysdeps-wince-glue.h
+++ b/dbus/dbus-sysdeps-wince-glue.h
@@ -237,6 +237,10 @@ DWORD GetTempPathA(DWORD,LPSTR);
BOOL SHGetSpecialFolderPathA(HWND,LPSTR,int,BOOL);
+#define OutputDebugStringA _dbus_wince_OutputDebugStringA
+void OutputDebugStringA(LPCSTR);
+
+
DBUS_END_DECLS
#endif /* DBUS_SYSDEPS_WINCE_GLUE_H */