From: Jens Steube Date: Mon, 27 Jun 2016 16:51:00 +0000 (+0200) Subject: Merge pull request #392 from unix-ninja/master X-Git-Tag: v3.00~4 X-Git-Url: https://www.flypig.org.uk/git/?a=commitdiff_plain;h=3370820109dd9c9dd46d29253c12a1e584556948;hp=115c95eb02ec194af5d6a62848ac5750f23a6e46;p=hashcat.git Merge pull request #392 from unix-ninja/master Various refactor changes --- diff --git a/include/common.h b/include/common.h index 7bdef11..c63d15a 100644 --- a/include/common.h +++ b/include/common.h @@ -38,17 +38,17 @@ #include #include #include +#include #ifdef LINUX #include #endif -#ifdef OSX +#ifdef DARWIN #include #include #include #include -#include #endif typedef void *OCL_LIB; @@ -58,7 +58,7 @@ typedef void *ADL_LIB; typedef void *NVAPI_LIB; typedef void *NVML_LIB; typedef void *XNVCTRL_LIB; -#ifdef OSX +#ifdef DARWIN #define __stdcall #endif #endif diff --git a/include/ext_OpenCL.h b/include/ext_OpenCL.h index d175fcc..4ffd56b 100644 --- a/include/ext_OpenCL.h +++ b/include/ext_OpenCL.h @@ -13,7 +13,7 @@ #define CL_USE_DEPRECATED_OPENCL_1_2_APIS #define CL_USE_DEPRECATED_OPENCL_2_0_APIS -#ifdef OSX +#ifdef DARWIN #include #endif diff --git a/include/shared.h b/include/shared.h index d543fb6..b0b3565 100644 --- a/include/shared.h +++ b/include/shared.h @@ -46,7 +46,7 @@ #define hc_thread_mutex_delete(m) pthread_mutex_destroy (&m) #endif -#ifdef OSX +#ifdef DARWIN typedef struct cpu_set { uint32_t count; diff --git a/include/types.h b/include/types.h index a1b0144..f1eca83 100644 --- a/include/types.h +++ b/include/types.h @@ -6,6 +6,12 @@ #ifndef TYPES_H #define TYPES_H +#ifdef _WIN +#define EOL "\r\n" +#else +#define EOL "\n" +#endif + typedef struct { uint salt_buf[16]; diff --git a/src/Makefile b/src/Makefile index cab2beb..6b0a413 100644 --- a/src/Makefile +++ b/src/Makefile @@ -107,7 +107,7 @@ BINARY_NATIVE := $(PROG_NAME) ifeq ($(UNAME),Darwin) export MACOSX_DEPLOYMENT_TARGET=10.9 BINARY_NATIVE := $(BINARY_NATIVE).app -CFLAGS_NATIVE := -D_POSIX -DOSX +CFLAGS_NATIVE := -D_POSIX -DDARWIN CFLAGS_NATIVE += $(CFLAGS) LFLAGS_NATIVE := -lpthread endif # darwin diff --git a/src/ext_OpenCL.c b/src/ext_OpenCL.c index 477afa2..9986c46 100644 --- a/src/ext_OpenCL.c +++ b/src/ext_OpenCL.c @@ -69,7 +69,7 @@ int ocl_init (OCL_PTR *ocl) #ifdef _WIN ocl->lib = hc_dlopen ("OpenCL"); - #elif OSX + #elif DARWIN 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/hashcat.c b/src/hashcat.c index 1effe6a..8d78174 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -6,7 +6,7 @@ * License.....: MIT */ -#ifdef OSX +#ifdef DARWIN #include #endif @@ -916,15 +916,7 @@ void status_display_machine_readable () * flush */ - #ifdef _WIN - fputc ('\r', out); - fputc ('\n', out); - #endif - - #ifdef _POSIX - fputc ('\n', out); - #endif - + fputs (EOL, out); fflush (out); } diff --git a/src/shared.c b/src/shared.c index b10790c..2cc6d9f 100644 --- a/src/shared.c +++ b/src/shared.c @@ -6,7 +6,7 @@ * License.....: MIT */ -#ifdef OSX +#ifdef DARWIN #include #endif @@ -2382,7 +2382,7 @@ int tty_fix() } #endif -#ifdef OSX +#ifdef DARWIN static struct termios savemodes; static int havemodes = 0; @@ -4358,7 +4358,7 @@ char *get_exec_path () const int len = GetModuleFileName (NULL, exec_path, exec_path_len - 1); - #elif OSX + #elif DARWIN uint size = exec_path_len; @@ -4495,7 +4495,7 @@ void truecrypt_crc32 (const char *filename, u8 keytab[64]) myfree (buf); } -#ifdef OSX +#ifdef DARWIN int pthread_setaffinity_np (pthread_t thread, size_t cpu_size, cpu_set_t *cpu_set) { int core; @@ -5763,7 +5763,7 @@ char **scan_directory (const char *path) if ((d = opendir (tmp_path)) != NULL) { - #ifdef OSX + #ifdef DARWIN struct dirent e; for (;;) {