[Nice] various patches for Windows / Visual Studio compilation
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:
> 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
> In particular
> - On file agent.c and tcp-bsd.c , as glib documentation suggests
> 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).
> - 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
> - 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
Also, why do you do :
+ WSADATA w;
+ WSAStartup(0x0202, &w);
Instead of doing :
+ WSADATA w;
+ WSAStartup(0x0202, &w);
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
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.
> Filippo Della Betta
> 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 è
> nice mailing list
> nice at lists.freedesktop.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 262 bytes
Desc: OpenPGP digital signature
More information about the nice