<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="2">
<div>I've just made a build of dbus-glib for Visual Studio 2008 (using winDBus). </div>
<div> </div>
<div>I just had to do a few tweaks to make this work</div>
<ul style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 19pt; ">
<li>Use config.h file generated on Linux build (I have a Core 2 Duo machine running Fedora 10)</li><li>Create an empty unistd.h include file</li><li>Link against libintl-proxy</li><li>A code change in dbus-gvalue.c.</li></ul>
<div> </div>
<div>A question to the maintainers - is his code change worthy of a check-in ? Or does someone have a better workaround ? See details below.</div>
<div> </div>
<div>Code change was in dbus-gvalue.c in demarshal_strv(). C does not accept variable declarations after statements, so the following code causes the Microsoft compiler to generate error C2143: syntax error : missing ';' before 'type' at the line <font face="Courier New">
</font><font face="Courier New" color="#0000FF">const</font><font face="Courier New"> </font><font face="Courier New" color="#0000FF">char</font><font face="Courier New"> *</font><font face="Courier New" color="#010001">str</font><font face="Courier New">;</font><font face="Arial, sans-serif">
(see snippet below)</font></div>
<div><font face="Arial, sans-serif"> </font></div>
<div><font face="Arial, sans-serif"> </font></div>
<div><font face="Courier New"> <font color="#0000FF">while</font> ((<font color="#010001">current_type</font> = <font color="#010001">dbus_message_iter_get_arg_type</font> (&<font color="#010001">subiter</font>)) != <font color="#010001">DBUS_TYPE_INVALID</font>)</font></div>
<div><font face="Courier New"> {</font></div>
<div><font face="Courier New"> <font color="#010001">g_assert</font> (<font color="#010001">current_type</font> == <font color="#010001">DBUS_TYPE_STRING</font>);</font></div>
<div><font face="Courier New"> <font color="#0000FF">const</font> <font color="#0000FF">char</font> *<font color="#010001">str</font>;</font></div>
<div><font face="Courier New"> <font color="#0000FF">char</font> *<font color="#010001">copy</font>;</font></div>
<div><font face="Courier New"> </font></div>
<div><font face="Courier New"> <font color="#010001">dbus_message_iter_get_basic</font> (&<font color="#010001">subiter</font>, &<font color="#010001">str</font>);</font></div>
<div><font face="Courier New"> <font color="#010001">copy</font> = <font color="#010001">g_strdup</font> (<font color="#010001">str</font>);</font></div>
<div><font face="Courier New"> <font color="#010001">g_array_append_val</font> (<font color="#010001">arr</font>, <font color="#010001">copy</font>);</font></div>
<div><font face="Courier New"> </font></div>
<div><font face="Courier New"> <font color="#010001">dbus_message_iter_next</font> (&<font color="#010001">subiter</font>);</font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New"> </font></div>
<div><font face="Arial, sans-serif">A simple change to put the delcrations before the other statements avoid the error (see below)</font></div>
<div><font face="Arial, sans-serif"> </font></div>
<div><font face="Courier New"> <font color="#0000FF">while</font> ((<font color="#010001">current_type</font> = <font color="#010001">dbus_message_iter_get_arg_type</font> (&<font color="#010001">subiter</font>)) != <font color="#010001">DBUS_TYPE_INVALID</font>)</font></div>
<div><font face="Courier New"> {</font></div>
<div><font face="Courier New"> <font color="#0000FF">const</font> <font color="#0000FF">char</font> *<font color="#010001">str</font>;</font></div>
<div><font face="Courier New"> <font color="#0000FF">char</font> *<font color="#010001">copy</font>;</font></div>
<div><font face="Courier New"> <font color="#010001">g_assert</font> (<font color="#010001">current_type</font> == <font color="#010001">DBUS_TYPE_STRING</font>);</font></div>
<div><font face="Courier New"> </font></div>
<div><font face="Courier New"> <font color="#010001">dbus_message_iter_get_basic</font> (&<font color="#010001">subiter</font>, &<font color="#010001">str</font>);</font></div>
<div><font face="Courier New"> <font color="#010001">copy</font> = <font color="#010001">g_strdup</font> (<font color="#010001">str</font>);</font></div>
<div><font face="Courier New"> <font color="#010001">g_array_append_val</font> (<font color="#010001">arr</font>, <font color="#010001">copy</font>);</font></div>
<div><font face="Courier New"> </font></div>
<div><font face="Courier New"> <font color="#010001">dbus_message_iter_next</font> (&<font color="#010001">subiter</font>);</font></div>
<div><font face="Courier New"> }</font></div>
<div><font face="Courier New"> </font></div>
<div><font face="Courier New"> </font></div>
<div>Thanks,</div>
<div> </div>
<div>Henry Bruce</div>
<div> </div>
<div> </div>
</font>
</body>
</html>