[Nice] various patches for Windows / Visual Studio compilation

Youness Alaoui youness.alaoui at collabora.co.uk
Tue Feb 14 10:16:37 PST 2012


On 02/14/2012 09:11 AM, Della Betta Filippo wrote:
> Hi,
Hi

> 
> attached you can find some patches that issue some Windows / Visual Studio
> compilation problem
Thanks, however, like I asked Rohan and Madaro, could you make those git
patches, as it makes it easier to apply, also, separate each patch into its own
commit.

> 
> In particular
> 
> -          On file agent.c and tcp-bsd.c , as glib documentation suggests
> (http://developer.gnome.org/glib/2.28/glib-IO-Channels.html),
> g_io_channel_unix_new should be avoided. Replaced with
> g_io_channel_win32_new_socket function on WIN32 platform
Good, but you broke the indentation in the file, please fix it to be indented
like the rest of the file.

> 
> -          On file pseudotcp.c, since Visual Studio compiler does not support
> C99 I put some declarations at the beginning of the statement. Moreover I
> expanded the macro g_debug to make Visual Studio happy. I tested it on
> mingw/msys and seems ok
Good catch, but like before, you broke the indentation in the file.
However, I don't understand why you had to expand the g_debug macro, you should
not have to do that.

> 
> -          On file sha1.h, I included the replacement header win32_common.h
> instead of the missing header stdint.h (at least on Visual Studio).
Good

> 
> -          On file win32_common.h I added , if not defined, typedef on size_t
> and ssize_t that are not defined on Visual Studio platform, I tested it on
> mingw/msys as well and seems ok
Good

> 
> -          On files test-*.c : most of the time WSAStartup is missing (causing
> test to fail immediately) , on test-pseudotcp.c EWOULDBLOCK is not defined.
> Moreover __func__ is missing and is replaced by __FUNCTION__
Good point about WSAStartup, not sure though if those should be put in the tests
or if it should be in libnice. Technically libnice does it when it discovers the
interfaces, however those unit tests are forcing the use of 127.0.0.1, that's
why it's not used, so maybe it's ok to leave it in the unit tests. In which
case, it would be a good thing to add a note to the nice_agent_add_local_address
documentation explaining that if it's used, then WSAStartup should be used on
windows.
Also, why do you do :
+#ifdef G_OS_WIN32
+  WSADATA w;
+#endif
+
+#ifdef G_OS_WIN32
+  WSAStartup(0x0202, &w);
+#endif

Instead of doing :
+#ifdef G_OS_WIN32
+  WSADATA w;
+
+  WSAStartup(0x0202, &w);
+#endif

I don't understand though why you replaced G_STRFUNC with __func__ since that
glib macro should take care of it and should be defined properly depending on
your compiler.

About the EWOULDBLOCK, I wonder if pseudotcp.h shouldn't have those defines
instead, so every user of the lib wouldn't need to define them. What do you think?

> 
>  
> 
> If you are interested, I can provide you with vcproj and/or sln files for Visual
> Studio 2008 (as well as config.h specific for Visual Studio)
Yes, I think it would be a good idea to put those files under a win32 directory,
maybe with a README.win32 file if you think it's necessary.

> 
> Regards,
> 
> Filippo Della Betta
> 
>  
Thank you,
Youness.

> 
> Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone
> indicate. La diffusione, copia o qualsiasi altra azione derivante dalla
> conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate
> ricevuto questo documento per errore siete cortesemente pregati di darne
> immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.
> 
> /This e-mail and any attachments// is //confidential and may contain privileged
> information intended for the addressee(s) only. Dissemination, copying, printing
> or use by anybody else is unauthorised. If you are not the intended recipient,
> please delete this message and any attachments and advise the sender by return
> e-mail, Thanks./
> 
> *rispetta l'ambienteRispetta l'ambiente. Non stampare questa mail se non è
> necessario.*
> 
> 
> 
> _______________________________________________
> nice mailing list
> nice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nice


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/nice/attachments/20120214/761b3156/attachment.pgp>


More information about the nice mailing list