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

Fix -Wundef warnings

This commit is contained in:
Rosen Penev 2016-08-26 21:05:44 -07:00
parent be47aebc24
commit aeee10fbeb
No known key found for this signature in database
GPG Key ID: 8B5A63249D3D4CE7
7 changed files with 22 additions and 22 deletions

View File

@ -1437,7 +1437,7 @@ char *logfile_generate_topid ();
char *logfile_generate_subid (); char *logfile_generate_subid ();
void logfile_append (const char *fmt, ...); void logfile_append (const char *fmt, ...);
#if F_SETLKW #ifdef F_SETLKW
void lock_file (FILE *fp); void lock_file (FILE *fp);
void unlock_file (FILE *fp); void unlock_file (FILE *fp);
#else #else

View File

@ -11,14 +11,14 @@ int adl_init (ADL_PTR *adl)
memset (adl, 0, sizeof (ADL_PTR)); memset (adl, 0, sizeof (ADL_PTR));
#ifdef _WIN #if defined( _WIN)
adl->lib = hc_dlopen ("atiadlxx.dll"); adl->lib = hc_dlopen ("atiadlxx.dll");
if (!adl->lib) if (!adl->lib)
{ {
adl->lib = hc_dlopen ("atiadlxy.dll"); adl->lib = hc_dlopen ("atiadlxy.dll");
} }
#elif _POSIX #elif defined(_POSIX)
adl->lib = hc_dlopen ("libatiadlxx.so", RTLD_NOW); adl->lib = hc_dlopen ("libatiadlxx.so", RTLD_NOW);
#endif #endif

View File

@ -67,9 +67,9 @@ int ocl_init (OCL_PTR *ocl)
memset (ocl, 0, sizeof (hc_opencl_lib_t)); memset (ocl, 0, sizeof (hc_opencl_lib_t));
#ifdef _WIN #if defined(_WIN)
ocl->lib = hc_dlopen ("OpenCL"); ocl->lib = hc_dlopen ("OpenCL");
#elif __APPLE__ #elif defined(__APPLE__)
ocl->lib = hc_dlopen ("/System/Library/Frameworks/OpenCL.framework/OpenCL", RTLD_NOW); ocl->lib = hc_dlopen ("/System/Library/Frameworks/OpenCL.framework/OpenCL", RTLD_NOW);
#else #else
ocl->lib = hc_dlopen ("libOpenCL.so", RTLD_NOW); ocl->lib = hc_dlopen ("libOpenCL.so", RTLD_NOW);

View File

@ -14,9 +14,9 @@ int nvapi_init (NVAPI_PTR *nvapi)
memset (nvapi, 0, sizeof (NVAPI_PTR)); memset (nvapi, 0, sizeof (NVAPI_PTR));
#ifdef _WIN #ifdef _WIN
#if __x86_64__ #if defined(__x86_64__)
nvapi->lib = hc_dlopen ("nvapi64.dll"); nvapi->lib = hc_dlopen ("nvapi64.dll");
#elif __x86__ #elif defined(__x86__)
nvapi->lib = hc_dlopen ("nvapi.dll"); nvapi->lib = hc_dlopen ("nvapi.dll");
#endif #endif
#else #else

View File

@ -11,12 +11,12 @@ int xnvctrl_init (XNVCTRL_PTR *xnvctrl)
memset (xnvctrl, 0, sizeof (XNVCTRL_PTR)); memset (xnvctrl, 0, sizeof (XNVCTRL_PTR));
#ifdef _WIN #if defined(_WIN)
// unsupport platform? // unsupport platform?
return -1; return -1;
#elif _POSIX #elif defined(_POSIX)
xnvctrl->lib_x11 = dlopen ("libX11.so", RTLD_LAZY); xnvctrl->lib_x11 = dlopen ("libX11.so", RTLD_LAZY);
@ -55,7 +55,7 @@ void xnvctrl_close (XNVCTRL_PTR *xnvctrl)
{ {
if (xnvctrl) if (xnvctrl)
{ {
#if _POSIX #ifdef _POSIX
if (xnvctrl->lib_x11) if (xnvctrl->lib_x11)
{ {

View File

@ -6679,7 +6679,7 @@ int main (int argc, char **argv)
char cpath[1024] = { 0 }; char cpath[1024] = { 0 };
#if _WIN #ifdef _WIN
snprintf (cpath, sizeof (cpath) - 1, "%s\\OpenCL\\", shared_dir); snprintf (cpath, sizeof (cpath) - 1, "%s\\OpenCL\\", shared_dir);
@ -6717,7 +6717,7 @@ int main (int argc, char **argv)
putenv (tmp); putenv (tmp);
} }
#if _WIN #ifdef _WIN
naive_replace (cpath_real, '\\', '/'); naive_replace (cpath_real, '\\', '/');
@ -14976,7 +14976,7 @@ int main (int argc, char **argv)
char *device_name_chksum = (char *) mymalloc (INFOSZ); 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); 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 #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); 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 }; char build_opts[1024] = { 0 };
#if _WIN #ifdef _WIN
snprintf (build_opts, sizeof (build_opts) - 1, "-I \"%s\"", cpath_real); snprintf (build_opts, sizeof (build_opts) - 1, "-I \"%s\"", cpath_real);
#else #else
snprintf (build_opts, sizeof (build_opts) - 1, "-I %s", cpath_real); snprintf (build_opts, sizeof (build_opts) - 1, "-I %s", cpath_real);
@ -17821,7 +17821,7 @@ int main (int argc, char **argv)
* open filehandles * open filehandles
*/ */
#if _WIN #ifdef _WIN
if (_setmode (_fileno (stdin), _O_BINARY) == -1) if (_setmode (_fileno (stdin), _O_BINARY) == -1)
{ {
log_error ("ERROR: %s: %s", "stdin", strerror (errno)); log_error ("ERROR: %s: %s", "stdin", strerror (errno));

View File

@ -2646,7 +2646,7 @@ char *logfile_generate_subid ()
* system * system
*/ */
#if F_SETLKW #ifdef F_SETLKW
void lock_file (FILE *fp) void lock_file (FILE *fp)
{ {
struct flock lock; 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) void set_cpu_affinity (char *cpu_affinity)
{ {
#ifdef _WIN #if defined(_WIN)
DWORD_PTR aff_mask = 0; DWORD_PTR aff_mask = 0;
#elif __FreeBSD__ #elif defined(__FreeBSD__)
cpuset_t cpuset; cpuset_t cpuset;
CPU_ZERO (&cpuset); CPU_ZERO (&cpuset);
#elif _POSIX #elif defined(_POSIX)
cpu_set_t cpuset; cpu_set_t cpuset;
CPU_ZERO (&cpuset); CPU_ZERO (&cpuset);
#endif #endif
@ -4594,13 +4594,13 @@ void set_cpu_affinity (char *cpu_affinity)
free (devices); free (devices);
} }
#ifdef _WIN #if defined( _WIN)
SetProcessAffinityMask (GetCurrentProcess (), aff_mask); SetProcessAffinityMask (GetCurrentProcess (), aff_mask);
SetThreadAffinityMask (GetCurrentThread (), aff_mask); SetThreadAffinityMask (GetCurrentThread (), aff_mask);
#elif __FreeBSD__ #elif defined(__FreeBSD__)
pthread_t thread = pthread_self (); pthread_t thread = pthread_self ();
pthread_setaffinity_np (thread, sizeof (cpuset_t), &cpuset); pthread_setaffinity_np (thread, sizeof (cpuset_t), &cpuset);
#elif _POSIX #elif defined(_POSIX)
pthread_t thread = pthread_self (); pthread_t thread = pthread_self ();
pthread_setaffinity_np (thread, sizeof (cpu_set_t), &cpuset); pthread_setaffinity_np (thread, sizeof (cpu_set_t), &cpuset);
#endif #endif