pinba_extension icon indicating copy to clipboard operation
pinba_extension copied to clipboard

Problem compiling for Windows

Open Ziggizag opened this issue 10 years ago • 4 comments
trafficstars

Hi,

While compiling with VS2012 x64 Cross Tools Command Prompt I suddenly get many syntax errors:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\nmake.exe" /I /nologo "php_pinba.dll

pinba-pb-c.c ext\pinba\pinba-pb-c.c(54) : error C2059: syntax error : '.' ext\pinba\pinba-pb-c.c(72) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(82) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(92) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(102) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(112) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(122) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(132) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(142) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(152) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(162) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(172) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(182) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(192) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(202) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(212) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(222) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(232) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(242) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(252) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(262) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(272) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(282) : error C2059: syntax error : ',' ext\pinba\pinba-pb-c.c(316) : error C2059: syntax error : '.'

Any idea?

Ziggizag avatar Sep 21 '15 14:09 Ziggizag

First of all, just to be sure you understand it: it was never ever supposed to be working on Windows and I'll be surprised if it does. Regarding your problem: according to the comments here http://stackoverflow.com/questions/23986521/c2059-in-vs2012-how-to-initialize-struct-instance only VS2013 started supporting this syntax, so you'll either have to upgrade the compiler, or rewrite the code to use the old C89 syntax (feel free to do it, since this autogenerated code is already patched).

tony2001 avatar Sep 21 '15 15:09 tony2001

Thank you, Anton. It will definitely work on Windows - no reason for failure besides minor (and fixable) discrepancies withing sys/time.h on this platform.

Worse is the necessity of code rewriting to C89 syntax. I hate this but the reason for that is all PHP systems we use are VC11 compiled (and the requirement to use Windows Servers is coming form our key customer - nevertheless - no problems with Windows at all - it is working surprisingly well with millions transactions each month!).

Ziggizag avatar Sep 21 '15 15:09 Ziggizag

I will check out this beast for this task:

https://github.com/libav/c99-to-c89/

Ziggizag avatar Sep 21 '15 15:09 Ziggizag

@Ziggizag shameless plug: while we wait for the php extension to be made compatible, you could use https://github.com/gggeek/pinba_php. It's a reimplementation of the same API in php: slower, uses more ram, and reports less accurate timing data. But it is tested on all php versions from 5.3 to 8.1

gggeek avatar Dec 06 '22 08:12 gggeek