Some cleanups
[hashcat.git] / include / shared.h
index 4a43b1d..c10c7d2 100644 (file)
     } \
   }
 
+#define HC_LOAD_ADDR(ptr,name,type,func,addr,libname,noerr) \
+  ptr->name = (type) (*ptr->func) (addr); \
+  if (!ptr->name) { \
+    if (noerr == 1) { \
+      log_error ("ERROR: %s at address %08x is missing from %s shared library.", #name, addr, #libname); \
+      exit (-1); \
+    } else { \
+      log_error ("WARNING: %s at address %08x is missing from %s shared library.", #name, addr, #libname); \
+      return (-1); \
+    } \
+  }
+
 /**
  * system stuff
  */
  * temperature management
  */
 
-#ifdef OSX
-#include <ext_smi.h>
-#include <ext_dummy.h>
-#elif _WIN
+#if _WIN
 #include <ext_ADL.h>
 #include <ext_nvapi.h>
 #else