1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 16:38:29 +00:00

Fixed some macros

This commit is contained in:
jsteube 2016-06-18 21:56:19 +02:00
parent e8aefb412c
commit 92a111be74
2 changed files with 19 additions and 19 deletions

View File

@ -4235,11 +4235,11 @@ static void *thread_monitor (void *p)
}
else if (device_param->device_vendor_id == VENDOR_ID_NV)
{
#ifdef _WIN
#ifdef WIN
hm_set_fanspeed_with_device_id_nvapi (device_id, fan_speed_new, 1);
#endif
#ifdef _LINUX
#ifdef LINUX
hm_set_fanspeed_with_device_id_xnvctrl (device_id, fan_speed_new);
#endif
}
@ -14070,11 +14070,11 @@ int main (int argc, char **argv)
{
need_nvml = 1;
#ifdef _LINUX
#ifdef LINUX
need_xnvctrl = 1;
#endif
#ifdef _WIN
#ifdef WIN
need_nvapi = 1;
#endif
}
@ -16184,12 +16184,12 @@ int main (int argc, char **argv)
}
else if (device_param->device_vendor_id == VENDOR_ID_NV)
{
#ifdef _WIN
rc = hm_set_fanspeed_with_device_id_nvapi (device_id, fanspeed, 1);
#ifdef LINUX
rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE);
#endif
#ifdef _LINUX
rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE);
#ifdef WIN
rc = hm_set_fanspeed_with_device_id_nvapi (device_id, fanspeed, 1);
#endif
}
@ -16199,7 +16199,7 @@ int main (int argc, char **argv)
}
else
{
//log_info ("WARNING: Failed to set initial fan speed for device #%u", device_id + 1);
log_info ("WARNING: Failed to set initial fan speed for device #%u", device_id + 1);
data.hm_device[device_id].fan_set_supported = 0;
}
@ -18390,12 +18390,12 @@ int main (int argc, char **argv)
}
else if (device_param->device_vendor_id == VENDOR_ID_NV)
{
#ifdef _WIN
rc = hm_set_fanspeed_with_device_id_nvapi (device_id, fanspeed, fanpolicy);
#ifdef LINUX
rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE);
#endif
#ifdef _LINUX
rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE);
#ifdef WIN
rc = hm_set_fanspeed_with_device_id_nvapi (device_id, fanspeed, fanpolicy);
#endif
}

View File

@ -2657,7 +2657,7 @@ void unlock_file (FILE *fp)
}
#endif // F_SETLKW
#ifdef _WIN
#ifdef WIN
void fsync (int fd)
{
HANDLE h = (HANDLE) _get_osfhandle (fd);
@ -4474,7 +4474,7 @@ int pthread_setaffinity_np (pthread_t thread, size_t cpu_size, cpu_set_t *cpu_se
void set_cpu_affinity (char *cpu_affinity)
{
#ifdef WIN
#ifdef _WIN
DWORD_PTR aff_mask = 0;
#elif _POSIX
cpu_set_t cpuset;
@ -4493,7 +4493,7 @@ void set_cpu_affinity (char *cpu_affinity)
if (cpu_id == 0)
{
#ifdef WIN
#ifdef _WIN
aff_mask = 0;
#elif _POSIX
CPU_ZERO (&cpuset);
@ -4509,7 +4509,7 @@ void set_cpu_affinity (char *cpu_affinity)
exit (-1);
}
#ifdef WIN
#ifdef _WIN
aff_mask |= 1 << (cpu_id - 1);
#elif _POSIX
CPU_SET ((cpu_id - 1), &cpuset);
@ -4520,7 +4520,7 @@ void set_cpu_affinity (char *cpu_affinity)
free (devices);
}
#ifdef WIN
#ifdef _WIN
SetProcessAffinityMask (GetCurrentProcess (), aff_mask);
SetThreadAffinityMask (GetCurrentThread (), aff_mask);
#elif _POSIX
@ -4743,7 +4743,7 @@ int sort_by_dictstat (const void *s1, const void *s2)
dictstat_t *d1 = (dictstat_t *) s1;
dictstat_t *d2 = (dictstat_t *) s2;
#ifdef LINUX
#ifdef _POSIX
d2->stat.st_atim = d1->stat.st_atim;
#else
d2->stat.st_atime = d1->stat.st_atime;