diff --git a/include/shared.h b/include/shared.h index 2bf830364..0808d2a05 100644 --- a/include/shared.h +++ b/include/shared.h @@ -1437,7 +1437,7 @@ char *logfile_generate_topid (); char *logfile_generate_subid (); void logfile_append (const char *fmt, ...); -#if F_SETLKW +#ifdef F_SETLKW void lock_file (FILE *fp); void unlock_file (FILE *fp); #else diff --git a/src/ext_ADL.c b/src/ext_ADL.c index d73792612..545eb90cb 100644 --- a/src/ext_ADL.c +++ b/src/ext_ADL.c @@ -11,14 +11,14 @@ int adl_init (ADL_PTR *adl) memset (adl, 0, sizeof (ADL_PTR)); - #ifdef _WIN + #if defined( _WIN) adl->lib = hc_dlopen ("atiadlxx.dll"); if (!adl->lib) { adl->lib = hc_dlopen ("atiadlxy.dll"); } - #elif _POSIX + #elif defined(_POSIX) adl->lib = hc_dlopen ("libatiadlxx.so", RTLD_NOW); #endif diff --git a/src/ext_OpenCL.c b/src/ext_OpenCL.c index b03b27274..2e44b2802 100644 --- a/src/ext_OpenCL.c +++ b/src/ext_OpenCL.c @@ -67,9 +67,9 @@ int ocl_init (OCL_PTR *ocl) memset (ocl, 0, sizeof (hc_opencl_lib_t)); - #ifdef _WIN + #if defined(_WIN) ocl->lib = hc_dlopen ("OpenCL"); - #elif __APPLE__ + #elif defined(__APPLE__) ocl->lib = hc_dlopen ("/System/Library/Frameworks/OpenCL.framework/OpenCL", RTLD_NOW); #else ocl->lib = hc_dlopen ("libOpenCL.so", RTLD_NOW); diff --git a/src/ext_nvapi.c b/src/ext_nvapi.c index 4aada02b5..5518868f5 100644 --- a/src/ext_nvapi.c +++ b/src/ext_nvapi.c @@ -14,9 +14,9 @@ int nvapi_init (NVAPI_PTR *nvapi) memset (nvapi, 0, sizeof (NVAPI_PTR)); #ifdef _WIN - #if __x86_64__ + #if defined(__x86_64__) nvapi->lib = hc_dlopen ("nvapi64.dll"); - #elif __x86__ + #elif defined(__x86__) nvapi->lib = hc_dlopen ("nvapi.dll"); #endif #else diff --git a/src/ext_xnvctrl.c b/src/ext_xnvctrl.c index c123e73a8..a55b5dd16 100644 --- a/src/ext_xnvctrl.c +++ b/src/ext_xnvctrl.c @@ -11,12 +11,12 @@ int xnvctrl_init (XNVCTRL_PTR *xnvctrl) memset (xnvctrl, 0, sizeof (XNVCTRL_PTR)); - #ifdef _WIN + #if defined(_WIN) // unsupport platform? return -1; - #elif _POSIX + #elif defined(_POSIX) xnvctrl->lib_x11 = dlopen ("libX11.so", RTLD_LAZY); @@ -55,7 +55,7 @@ void xnvctrl_close (XNVCTRL_PTR *xnvctrl) { if (xnvctrl) { - #if _POSIX + #ifdef _POSIX if (xnvctrl->lib_x11) { diff --git a/src/hashcat.c b/src/hashcat.c index 9e0bb741a..b6ee2efd5 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -6679,7 +6679,7 @@ int main (int argc, char **argv) char cpath[1024] = { 0 }; - #if _WIN + #ifdef _WIN snprintf (cpath, sizeof (cpath) - 1, "%s\\OpenCL\\", shared_dir); @@ -6717,7 +6717,7 @@ int main (int argc, char **argv) putenv (tmp); } - #if _WIN + #ifdef _WIN naive_replace (cpath_real, '\\', '/'); @@ -14976,7 +14976,7 @@ int main (int argc, char **argv) char *device_name_chksum = (char *) mymalloc (INFOSZ); - #if __x86_64__ + #ifdef __x86_64__ snprintf (device_name_chksum, INFOSZ - 1, "%u-%u-%u-%s-%s-%s-%u", 64, device_param->platform_vendor_id, device_param->vector_width, device_param->device_name, device_param->device_version, device_param->driver_version, COMPTIME); #else snprintf (device_name_chksum, INFOSZ - 1, "%u-%u-%u-%s-%s-%s-%u", 32, device_param->platform_vendor_id, device_param->vector_width, device_param->device_name, device_param->device_version, device_param->driver_version, COMPTIME); @@ -16302,7 +16302,7 @@ int main (int argc, char **argv) char build_opts[1024] = { 0 }; - #if _WIN + #ifdef _WIN snprintf (build_opts, sizeof (build_opts) - 1, "-I \"%s\"", cpath_real); #else snprintf (build_opts, sizeof (build_opts) - 1, "-I %s", cpath_real); @@ -17821,7 +17821,7 @@ int main (int argc, char **argv) * open filehandles */ - #if _WIN + #ifdef _WIN if (_setmode (_fileno (stdin), _O_BINARY) == -1) { log_error ("ERROR: %s: %s", "stdin", strerror (errno)); diff --git a/src/shared.c b/src/shared.c index eb5ca3acb..04750caae 100644 --- a/src/shared.c +++ b/src/shared.c @@ -2646,7 +2646,7 @@ char *logfile_generate_subid () * system */ -#if F_SETLKW +#ifdef F_SETLKW void lock_file (FILE *fp) { struct flock lock; @@ -4545,12 +4545,12 @@ 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 + #if defined(_WIN) DWORD_PTR aff_mask = 0; - #elif __FreeBSD__ + #elif defined(__FreeBSD__) cpuset_t cpuset; CPU_ZERO (&cpuset); - #elif _POSIX + #elif defined(_POSIX) cpu_set_t cpuset; CPU_ZERO (&cpuset); #endif @@ -4594,13 +4594,13 @@ void set_cpu_affinity (char *cpu_affinity) free (devices); } - #ifdef _WIN + #if defined( _WIN) SetProcessAffinityMask (GetCurrentProcess (), aff_mask); SetThreadAffinityMask (GetCurrentThread (), aff_mask); - #elif __FreeBSD__ + #elif defined(__FreeBSD__) pthread_t thread = pthread_self (); pthread_setaffinity_np (thread, sizeof (cpuset_t), &cpuset); - #elif _POSIX + #elif defined(_POSIX) pthread_t thread = pthread_self (); pthread_setaffinity_np (thread, sizeof (cpu_set_t), &cpuset); #endif