opened
hjfbswb
username_0
(1)There is no inttypes.h on vs2012.
(2)There is no function snprintf on vs2012.
(3)Vs2012 seems having a strict check on c variable declaration location.
solve compilation problems on vs2012
issue
created
lws-team
username_1
Have you maybe missed the cmake tests for LWS_HAVE_SNPRINTF / __SNPRINTF?

Appveyor has them, but your patch kills the CI build there as it is

https://ci.appveyor.com/project/username_1/libwebsockets/builds/26377922/job/romy2ch8tirrstxm
comment
created
hjfbswb
username_0
https://github.com/username_0/libwebsockets/blob/6b79ee5d195f53243fbd62582eca51f34ca2dfaa/cmake/lws_config_private.h.in#L125

I added them(See above),  and it work well in my computer.
But cmake did not find neither snprintf nor _snprintf, how can this happen?

![image](https://user-images.githubusercontent.com/15307479/62258673-ec2eb700-b43d-11e9-9f00-b86f85048617.png)
comment
created
lws-team
username_1
I don't know... but looking at how to solve it both ways, actually there is a function lws_snprintf() that is preferred to use compared to snprintf.

Internally, it actually uses vsnprintf().  So since this builds OK normally, I guess it can normally find `*snprintf()` when you build it, even if cmake can't find it for some reason.

How about modifying your patch so it just assumes the existence of _snprintf() if on windows, it looks like it might work around it.
comment
created
hjfbswb
username_0
(1)I think the better way is replacing `snprintf` with `lws_snprint`, and i did it.
(2)Difine `int64_t`, `uint64_t`,`int32_t` and `int16_t` to solve compilation errors on vs2008.
comment
created
lws-team
username_1
Thanks... I pushed it on master and backported it to v3.1-stable as well.
comment