fix 64bit support on windows (partial, stil horrible casting happening, no garantee to get the right cpu id, and most likely on some other platform as well

This commit is contained in:
Pierre Joye
2015-02-18 08:57:38 -08:00
parent 743d3bfacc
commit 483c1e58fa

View File

@@ -81,9 +81,10 @@ extern zend_module_entry uprofiler_module_entry;
* Patch for compiling in Win32/64
* @author Benjamin Carl <opensource@clickalicious.de>
*/
# define cpu_set_t PDWORD_PTR
# define CPU_SET(cpu_id, new_mask) (*(new_mask)) = (cpu_id + 1)
# define CPU_ZERO(new_mask) (*(new_mask)) = 0
# define SET_AFFINITY(pid, size, mask) SetProcessAffinityMask(GetCurrentProcess(), (DWORD_PTR)mask)
# define SET_AFFINITY(pid, size, mask) SetProcessAffinityMask(GetCurrentProcess(), mask)
# define GET_AFFINITY(pid, size, mask) \
GetProcessAffinityMask(GetCurrentProcess(), mask, &s_mask)
#else