mirror of
https://github.com/hashcat/hashcat.git
synced 2025-02-16 01:22:06 +00:00
Replace DARWIN macro with __APPLE__
As discussed on https://github.com/hashcat/hashcat/pull/409
This commit is contained in:
parent
2043338859
commit
96f2ade4bb
@ -10,6 +10,7 @@
|
||||
- The Time.Estimated attribute in status display should also show --runtime limit if user set it
|
||||
- Fix some strict aliasing rule violation on older compilers
|
||||
- Fix some variable initializers on older compilers
|
||||
- Replace DARWIN macro with __APPLE__
|
||||
|
||||
##
|
||||
## Bugs
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#ifdef DARWIN
|
||||
#ifdef __APPLE__
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <mach-o/dyld.h>
|
||||
@ -64,7 +64,7 @@ typedef void *ADL_LIB;
|
||||
typedef void *NVAPI_LIB;
|
||||
typedef void *NVML_LIB;
|
||||
typedef void *XNVCTRL_LIB;
|
||||
#ifdef DARWIN
|
||||
#ifdef __APPLE__
|
||||
#define __stdcall
|
||||
#endif
|
||||
#endif
|
||||
|
@ -13,7 +13,7 @@
|
||||
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
|
||||
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
|
||||
|
||||
#ifdef DARWIN
|
||||
#ifdef __APPLE__
|
||||
#include <OpenCL/cl.h>
|
||||
#endif
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
#define hc_thread_mutex_delete(m) pthread_mutex_destroy (&m)
|
||||
#endif
|
||||
|
||||
#ifdef DARWIN
|
||||
#ifdef __APPLE__
|
||||
typedef struct cpu_set
|
||||
{
|
||||
uint32_t count;
|
||||
|
@ -113,7 +113,7 @@ BINARY_NATIVE := $(PROG_NAME)
|
||||
|
||||
ifeq ($(UNAME),Darwin)
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
CFLAGS_NATIVE := -D_POSIX -DDARWIN
|
||||
CFLAGS_NATIVE := -D_POSIX
|
||||
CFLAGS_NATIVE += $(CFLAGS)
|
||||
LFLAGS_NATIVE := -lpthread
|
||||
LFLAGS_NATIVE += $(LDFLAGS)
|
||||
|
@ -69,7 +69,7 @@ int ocl_init (OCL_PTR *ocl)
|
||||
|
||||
#ifdef _WIN
|
||||
ocl->lib = hc_dlopen ("OpenCL");
|
||||
#elif DARWIN
|
||||
#elif __APPLE__
|
||||
ocl->lib = hc_dlopen ("/System/Library/Frameworks/OpenCL.framework/OpenCL", RTLD_NOW);
|
||||
#else
|
||||
ocl->lib = hc_dlopen ("libOpenCL.so", RTLD_NOW);
|
||||
|
@ -6,7 +6,11 @@
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#if defined(DARWIN) || defined(__FreeBSD__)
|
||||
#ifdef __APPLE__
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
|
19
src/shared.c
19
src/shared.c
@ -6,7 +6,7 @@
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#ifdef DARWIN
|
||||
#ifdef __APPLE__
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
@ -2387,7 +2387,7 @@ int tty_fix()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DARWIN) || defined(__FreeBSD__)
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__)
|
||||
static struct termios savemodes;
|
||||
static int havemodes = 0;
|
||||
|
||||
@ -4365,7 +4365,7 @@ char *get_exec_path ()
|
||||
|
||||
const int len = GetModuleFileName (NULL, exec_path, exec_path_len - 1);
|
||||
|
||||
#elif DARWIN
|
||||
#elif __APPLE__
|
||||
|
||||
uint size = exec_path_len;
|
||||
|
||||
@ -4519,7 +4519,7 @@ void truecrypt_crc32 (const char *filename, u8 keytab[64])
|
||||
myfree (buf);
|
||||
}
|
||||
|
||||
#ifdef DARWIN
|
||||
#ifdef __APPLE__
|
||||
int pthread_setaffinity_np (pthread_t thread, size_t cpu_size, cpu_set_t *cpu_set)
|
||||
{
|
||||
int core;
|
||||
@ -5794,11 +5794,14 @@ char **scan_directory (const char *path)
|
||||
|
||||
if ((d = opendir (tmp_path)) != NULL)
|
||||
{
|
||||
#ifdef DARWIN
|
||||
#ifdef __APPLE__
|
||||
|
||||
struct dirent e;
|
||||
|
||||
for (;;) {
|
||||
for (;;)
|
||||
{
|
||||
memset (&e, 0, sizeof (e));
|
||||
|
||||
struct dirent *de = NULL;
|
||||
|
||||
if (readdir_r (d, &e, &de) != 0)
|
||||
@ -5809,12 +5812,16 @@ char **scan_directory (const char *path)
|
||||
}
|
||||
|
||||
if (de == NULL) break;
|
||||
|
||||
#else
|
||||
|
||||
struct dirent *de;
|
||||
|
||||
while ((de = readdir (d)) != NULL)
|
||||
{
|
||||
|
||||
#endif
|
||||
|
||||
if ((strcmp (de->d_name, ".") == 0) || (strcmp (de->d_name, "..") == 0)) continue;
|
||||
|
||||
int path_size = strlen (tmp_path) + 1 + strlen (de->d_name);
|
||||
|
Loading…
Reference in New Issue
Block a user