mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-23 00:28:11 +00:00
Fix -Wundef warnings
This commit is contained in:
parent
be47aebc24
commit
aeee10fbeb
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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));
|
||||
|
14
src/shared.c
14
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
|
||||
|
Loading…
Reference in New Issue
Block a user