mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-11-15 09:23:56 +01:00
fix windows support
- fix broken windows support
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include <math.h>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
@@ -552,7 +553,7 @@ size_t InitOpenCL(GpuContext* ctx, size_t num_gpus, size_t platform_idx)
|
||||
#ifdef __GNUC__
|
||||
cl_platform_id PlatformIDList[entries];
|
||||
#else
|
||||
cl_platform_id* PlatformIDList = _alloca(entries * sizeof(cl_platform_id));
|
||||
cl_platform_id* PlatformIDList = (cl_platform_id*)_alloca(entries * sizeof(cl_platform_id));
|
||||
#endif
|
||||
if((ret = clGetPlatformIDs(entries, PlatformIDList, NULL)) != CL_SUCCESS)
|
||||
{
|
||||
@@ -579,7 +580,7 @@ size_t InitOpenCL(GpuContext* ctx, size_t num_gpus, size_t platform_idx)
|
||||
#ifdef __GNUC__
|
||||
cl_device_id DeviceIDList[entries];
|
||||
#else
|
||||
cl_device_id* DeviceIDList = _alloca(entries * sizeof(cl_device_id));
|
||||
cl_device_id* DeviceIDList = (cl_device_id*)_alloca(entries * sizeof(cl_device_id));
|
||||
#endif
|
||||
if((ret = clGetDeviceIDs(PlatformIDList[platform_idx], CL_DEVICE_TYPE_GPU, entries, DeviceIDList, NULL)) != CL_SUCCESS)
|
||||
{
|
||||
@@ -591,7 +592,7 @@ size_t InitOpenCL(GpuContext* ctx, size_t num_gpus, size_t platform_idx)
|
||||
#ifdef __GNUC__
|
||||
cl_device_id TempDeviceList[num_gpus];
|
||||
#else
|
||||
cl_device_id* TempDeviceList = _alloca(entries * sizeof(cl_device_id));
|
||||
cl_device_id* TempDeviceList = (cl_device_id*)_alloca(entries * sizeof(cl_device_id));
|
||||
#endif
|
||||
for(int i = 0; i < num_gpus; ++i)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ private:
|
||||
// Bottom 24 bits allow for an hour of work at 4000 H/s
|
||||
inline uint32_t calc_start_nonce(uint32_t resume)
|
||||
{
|
||||
return reverseBits<uint32_t>(iThreadNo + GlobalStates::iThreadCount * resume);
|
||||
return reverseBits<uint32_t>(static_cast<uint32_t>(iThreadNo + GlobalStates::iThreadCount * resume));
|
||||
}
|
||||
|
||||
void work_main();
|
||||
|
||||
Reference in New Issue
Block a user