longxinH / xhprof

PHP7/PHP8 support
http://pecl.php.net/package/xhprof
Apache License 2.0
1.09k stars 167 forks source link

Add basic Windows support #35

Closed cmb69 closed 4 years ago

cmb69 commented 4 years ago

We add the required config.w32, and also use some POSIX compatibility includes from PHP. Furthermore, we use QueryPerformanceCounter() on Windows, and optimize the use of QueryPerformanceFrequency() by calling it once on MINIT, and storing the result in a true global variable.


This is just the most basic Windows support. With the patch, xhprof compiles for me locally with PHP 7.3 x64 NTS, but I still have three failing tests; two of them fail due to stack corruption, likely caused by variables being declared as long which are usually 8 bytes on *nix, but 4 bytes on Windows. It's probably better to use more portable types, such as zend_long or int64_t.

longxinH commented 4 years ago

thank you very much