#include <semaphore.h>
#include <dlfcn.h>
#include <pwd.h>
+#include <limits.h>
-#ifdef LINUX
-#include <termio.h>
+#ifdef __linux__
+#include <termios.h>
+#include <sys/ioctl.h>
#endif
-#ifdef OSX
+#ifdef __APPLE__
#include <termios.h>
#include <sys/ioctl.h>
#include <mach-o/dyld.h>
#include <mach/mach.h>
#endif
+#ifdef __FreeBSD__
+#include <termios.h>
+#include <sys/ioctl.h>
+#endif
+
typedef void *OCL_LIB;
#ifdef HAVE_HWMON
typedef void *NVAPI_LIB;
typedef void *NVML_LIB;
typedef void *XNVCTRL_LIB;
-#ifdef OSX
+#ifdef __APPLE__
#define __stdcall
#endif
#endif
* functions
*/
-void log_out_nn (FILE *fp, const char *fmt, ...);
-void log_info_nn (const char *fmt, ...);
-void log_error_nn (const char *fmt, ...);
+int log_out_nn (FILE *fp, const char *fmt, ...);
+int log_info_nn (const char *fmt, ...);
+int log_error_nn (const char *fmt, ...);
-void log_out (FILE *fp, const char *fmt, ...);
-void log_info (const char *fmt, ...);
-void log_error (const char *fmt, ...);
+int log_out (FILE *fp, const char *fmt, ...);
+int log_info (const char *fmt, ...);
+int log_error (const char *fmt, ...);
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))