Works now with Windows Visual Studio C++ too
[owTools.git] / src / owInterface.h
index 952f3dc..0370d03 100755 (executable)
 #ifndef __OWINTERFACES_H_
 #define __OWINTERFACES_H_
 
+#if defined(WIN) || defined(LINUX)
+#else
+#if defined(_WINDOWS) || defined(__WINDOWS__) || defined(_WIN32) || defined(WIN32)
+#define WIN
+#else
+#define LINUX
+#endif
+#endif
+
+
 #include <vector>
 #include <stdint.h>
 #include <string>
+#ifdef LINUX
 #include <termios.h>
+#endif
 #include <stdarg.h>
 
+#ifdef WIN
+#include <Windows.h>
+
+#endif
 
 class owDevice;
 class owDeviceConfig;
@@ -48,7 +64,7 @@ class owDeviceConfig;
 #if defined(_WINDOWS) || defined(__WINDOWS__) || defined(_WIN32) || defined(WIN32)
    #define USE_WINDOWS_TIME 1
    #include <windows.h>
-   #include "win32/usb.h" // libusb header
+   //#include "win32/usb.h" // libusb header
 #else
    #define USE_WINDOWS_TIME 0
    #include <time.h>
@@ -84,7 +100,12 @@ public:
                va_list arg;
                int done;
                va_start (arg, format);
+#ifdef LINUX
                done = vsprintf (s, format, arg);
+#endif
+#ifdef WIN
+               done = vsprintf_s(s,300, format, arg);
+#endif
                va_end (arg);
                logtext=s;
                level=llevel;