#include <switch.h>
#include <switch_version.h>
-#include <sys/time.h>
+
#ifndef WIN32
+#include <sys/time.h>
#include <X11/Xlib.h>
#include <X11/Xlibint.h>
#include <X11/Xatom.h>
//Windows macro for FD_SET includes a warning C4127: conditional expression is constant
#pragma warning(push)
#pragma warning(disable:4127)
+
+/***************/
+// from http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/
+
+#include <time.h>\r
+ \r
+#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)\r
+#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64\r
+#else\r
+#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL\r
+#endif\r
+ \r
+ struct timezone \r
+ {\r
+ int tz_minuteswest; /* minutes W of Greenwich */\r
+ int tz_dsttime; /* type of dst correction */\r
+ };\r
+ \r
+ int gettimeofday(struct timeval *tv, struct timezone *tz)\r
+ {\r
+ FILETIME ft;\r
+ unsigned __int64 tmpres = 0;\r
+ static int tzflag;\r
+ \r
+ if (NULL != tv)\r
+ {\r
+ GetSystemTimeAsFileTime(&ft);\r
+ \r
+ tmpres |= ft.dwHighDateTime;\r
+ tmpres <<= 32;\r
+ tmpres |= ft.dwLowDateTime;\r
+ \r
+ /*converting file time to unix epoch*/\r
+ tmpres /= 10; /*convert into microseconds*/\r
+ tmpres -= DELTA_EPOCH_IN_MICROSECS; \r
+ tv->tv_sec = (long)(tmpres / 1000000UL);\r
+ tv->tv_usec = (long)(tmpres % 1000000UL);\r
+ }\r
+ \r
+ if (NULL != tz)\r
+ {\r
+ if (!tzflag)\r
+ {\r
+ _tzset();\r
+ tzflag++;\r
+ }\r
+ tz->tz_minuteswest = _timezone / 60;\r
+ tz->tz_dsttime = _daylight;\r
+ }\r
+ \r
+ return 0;\r
+ }\r
+/***************/
+
#endif
#define SAMPLERATE_SKYPIAX 16000
/* this is the call in which we are calling out */
DEBUGA_SKYPE("Call %s NOTHING\n", SKYPIAX_P_LOG, id);
} else {
- usleep(400000); //0.4 seconds
+ skypiax_sleep(400000); //0.4 seconds
DEBUGA_SKYPE("Call %s TRY TRANSFER\n", SKYPIAX_P_LOG, id);
skypiax_transfer(tech_pvt, id, value);
}