Replace LINUX macro with compiler predefined macro __linux__
authorjsteube <jens.steube@gmail.com>
Fri, 8 Jul 2016 21:23:16 +0000 (23:23 +0200)
committerjsteube <jens.steube@gmail.com>
Fri, 8 Jul 2016 21:23:16 +0000 (23:23 +0200)
docs/changes.txt
include/common.h
include/ext_OpenCL.h
src/Makefile
src/ext_OpenCL.c
src/hashcat.c
src/shared.c

index 9e84431..2c4818c 100644 (file)
@@ -10,7 +10,8 @@
 - 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__
+- Replace DARWIN macro with compiler predefined macro __APPLE__
+- Replace LINUX macro with compiler predefined macro __linux__
 
 ##
 ## Bugs
index 91cb370..c36a3e0 100644 (file)
@@ -40,7 +40,7 @@
 #include <pwd.h>
 #include <limits.h>
 
-#ifdef LINUX
+#ifdef __linux__
 #include <termios.h>
 #include <sys/ioctl.h>
 #endif
index c3598c9..5ba85f3 100644 (file)
@@ -22,7 +22,7 @@
 // #include <CL/cl_ext.h> // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPU
 #endif
 
-#ifdef LINUX
+#ifdef __linux__
 #include <CL/cl.h>
 // #include <CL/cl_ext.h> // used for CL_DEVICE_TOPOLOGY_AMD but broken for dual GPU
 #endif
index 6cd6684..1ec2b2d 100644 (file)
@@ -120,7 +120,7 @@ LFLAGS_NATIVE            += $(LDFLAGS)
 endif # darwin
 
 ifeq ($(UNAME),Linux)
-CFLAGS_NATIVE            := -D_POSIX -DLINUX
+CFLAGS_NATIVE            := -D_POSIX
 ifndef DEBUG
 CFLAGS_NATIVE            += -s
 endif
@@ -141,7 +141,7 @@ endif # freebsd
 ## Cross compilation target
 ##
 
-CFLAGS_CROSS_LINUX       := -D_POSIX -DLINUX
+CFLAGS_CROSS_LINUX       := -D_POSIX
 ifndef DEBUG
 CFLAGS_CROSS_LINUX       += -s
 endif
index 9bbca71..cab332a 100644 (file)
@@ -82,7 +82,7 @@ int ocl_init (OCL_PTR *ocl)
     log_info ("");
     log_info ("ATTENTION! Can't find OpenCL ICD loader library");
     log_info ("");
-    #if defined (LINUX)
+    #ifdef __linux__
     log_info ("You're probably missing the \"ocl-icd-libopencl1\" package (Debian/Ubuntu)");
     log_info ("  sudo apt-get install ocl-icd-libopencl1");
     log_info ("");
index 0049333..89076e4 100644 (file)
@@ -4350,7 +4350,7 @@ static void *thread_monitor (void *p)
                     hm_set_fanspeed_with_device_id_nvapi (device_id, fan_speed_new, 1);
                     #endif
 
-                    #ifdef LINUX
+                    #ifdef __linux__
                     hm_set_fanspeed_with_device_id_xnvctrl (device_id, fan_speed_new);
                     #endif
                   }
@@ -6179,7 +6179,7 @@ int main (int argc, char **argv)
   char *exec_path = get_exec_path ();
 
 
-  #if defined(LINUX) || defined(__APPLE__) || defined(__FreeBSD__)
+  #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
 
   char *resolved_install_folder = realpath (INSTALL_FOLDER, NULL);
   char *resolved_exec_path      = realpath (exec_path, NULL);
@@ -14255,7 +14255,7 @@ int main (int argc, char **argv)
           {
             need_nvml = 1;
 
-            #ifdef LINUX
+            #ifdef __linux__
             need_xnvctrl = 1;
             #endif
 
@@ -16459,7 +16459,7 @@ int main (int argc, char **argv)
               }
               else if (device_param->device_vendor_id == VENDOR_ID_NV)
               {
-                #ifdef LINUX
+                #ifdef __linux__
                 rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_TRUE);
                 #endif
 
@@ -18641,7 +18641,7 @@ int main (int argc, char **argv)
             }
             else if (device_param->device_vendor_id == VENDOR_ID_NV)
             {
-              #ifdef LINUX
+              #ifdef __linux__
               rc = set_fan_control (data.hm_xnvctrl, data.hm_device[device_id].xnvctrl, NV_CTRL_GPU_COOLER_MANUAL_CONTROL_FALSE);
               #endif
 
index f4c76f9..f693122 100644 (file)
@@ -2338,7 +2338,7 @@ void drupal7_encode (u8 digest[64], u8 buf[43])
  * tty
  */
 
-#ifdef LINUX
+#ifdef __linux__
 static struct termios savemodes;
 static int havemodes = 0;
 
@@ -4353,7 +4353,7 @@ char *get_exec_path ()
 
   char *exec_path = (char *) mymalloc (exec_path_len);
 
-  #ifdef LINUX
+  #ifdef __linux__
 
   char tmp[32] = { 0 };
 
@@ -4821,7 +4821,7 @@ int sort_by_dictstat (const void *s1, const void *s2)
   dictstat_t *d1 = (dictstat_t *) s1;
   dictstat_t *d2 = (dictstat_t *) s2;
 
-  #ifdef _LINUX
+  #ifdef __linux__
   d2->stat.st_atim = d1->stat.st_atim;
   #else
   d2->stat.st_atime = d1->stat.st_atime;