Merge pull request #392 from unix-ninja/master

Various refactor changes
pull/394/head
Jens Steube 8 years ago committed by GitHub
commit 3370820109

@ -38,17 +38,17 @@
#include <semaphore.h>
#include <dlfcn.h>
#include <pwd.h>
#include <limits.h>
#ifdef LINUX
#include <termio.h>
#endif
#ifdef OSX
#ifdef DARWIN
#include <termios.h>
#include <sys/ioctl.h>
#include <mach-o/dyld.h>
#include <mach/mach.h>
#include <limits.h>
#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

@ -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 <OpenCL/cl.h>
#endif

@ -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;

@ -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];

@ -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

@ -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);

@ -6,7 +6,7 @@
* License.....: MIT
*/
#ifdef OSX
#ifdef DARWIN
#include <stdio.h>
#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);
}

@ -6,7 +6,7 @@
* License.....: MIT
*/
#ifdef OSX
#ifdef DARWIN
#include <stdio.h>
#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 (;;) {

Loading…
Cancel
Save