From abd7b2bfcc1582884310c669eb94a66a1e166362 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 21 Feb 2017 22:08:50 -0800 Subject: [PATCH] Simplify common.h a bit. --- include/common.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/common.h b/include/common.h index 44d90a902..99014ba98 100644 --- a/include/common.h +++ b/include/common.h @@ -8,16 +8,11 @@ #define PROGNAME "hashcat" -#if defined (__linux__) || defined (__CYGWIN__) +#if defined (__unix__) || defined (__APPLE__) #define _POSIX -#elif defined (__APPLE__) -#define _POSIX -#elif defined (__FreeBSD__) -#define _POSIX -#elif defined (_WIN32) || defined (_WIN64) +#elif defined (__WINNT__) #define _WIN 1 #define WIN 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L //for *time_r functions #else #error Your Operating System is not supported or detected #endif @@ -26,7 +21,15 @@ #define _GNU_SOURCE #endif +// needed for *time_r functions under MinGW +#ifndef _POSIX_THREAD_SAFE_FUNCTIONS +#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L +#endif + +// needed for 64-bit off_t on 32-bit OSes +#ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 +#endif #define NOMINMAX 1