|
From: John E. <jo...@ti...> - 2016-05-16 08:34:06
|
Hi guys, I'm just bumping this in case it got missed upstream...
I've fixed the problem locally but it should probably get fixed in
master. Best regards,
John
On 02/05/2016 11:32, John Emmas wrote:
> I just came across a compiler issue when building with MSVC. It's in
> the function alloc_server_thread() (in 'src/server_thread.c'):-
>
> static lo_server_thread alloc_server_thread(lo_server s)
> {
> if (!s)
> return NULL;
> lo_server_thread st = (lo_server_thread) // <--- PROBLEM IS
> AT THIS LINE !!!
> malloc(sizeof(struct _lo_server_thread));
>
> // rest of function. . .
> }
>
> The problem arises because 'server_thread.c' is a 'C' file (as opposed
> to C++). 'C' does not allow variables to get declared half way down a
> function (they need to get declared at the top of the function). Many
> compilers ignore that nowadays but MSVC is still quite strict about
> stuff like that. So making this small change enables it to compile
> correctly:-
>
> static lo_server_thread alloc_server_thread(lo_server s)
> {
> lo_server_thread st; // <--- MOVE THE DECLARATION TO HERE
>
> if (!s)
> return NULL;
> st = (lo_server_thread) malloc(sizeof(struct _lo_server_thread));
>
> // rest of function. . .
> }
>
> Just thought I'd pass this upstream. Best regards,
>
> John
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> liblo-devel mailing list
> lib...@li...
> https://lists.sourceforge.net/lists/listinfo/liblo-devel
>
|