]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Wrap OutputDebugString for Windows CE builds, and add cast for MSVC.
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Fri, 11 Jun 2010 00:04:36 +0000 (02:04 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Mon, 19 Jul 2010 08:32:08 +0000 (10:32 +0200)
dbus/dbus-internals.c
dbus/dbus-sysdeps-util-win.c
dbus/dbus-sysdeps-wince-glue.c
dbus/dbus-sysdeps-wince-glue.h

index 1ab6731a7b2da8040d5628667bacb1ac008141f3..2ed56b35d13f4c54c3c584864cfc31ff7db92bc1 100644 (file)
@@ -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
index 6c101e7d101de75e6e5e692b0e3178e26d963aa1..2f21409221a092a310ce035c3c05dbd88b54ca77 100644 (file)
@@ -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);
index 3eaeadabf2adc3ecc16009c0bddc23ce139a8700..74b1371fb5caa77cb6ac31d43d54cb612661179b 100644 (file)
@@ -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);
+}
index 7a6462b2e77e6a4e6c7c95cf2eba3f2ae0e8d7e6..f5ac6c8a0eb2ee0e018a04c940303f6cbba4c6eb 100644 (file)
@@ -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 */