All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
EegeoWindowsGuard.h
1 #pragma once
2 
3 #include <WinSock2.h>
4 #include <netlistmgr.h>
5 #include <d3d9.h>
6 #define WIN32_LEAN_AND_MEAN
7 #ifdef NOMINMAX
8 #include <windows.h>
9 #else
10 #define NOMINMAX
11 #include <windows.h>
12 #undef NOMINMAX
13 #endif
14 
15 #include <atlbase.h>
16 #include <uv.h>
17 
18 #undef near
19 #undef far
20 #undef ERROR
21 #undef DrawText
22 #undef FAR
23 #undef DeleteFile
24 #undef GetMessage
25 
26 //for jmorecfg.h
27 //(jpeg.lib)
28 #define HAVE_BOOLEAN
29 #define XMD_H
30 
31 #include <iterator>
32 #include <algorithm>
33 #include <functional>
34 #include <cctype>
35 
36 #include <stdint.h>
37 
38 //typedef struct timeval {
39 // long tv_sec;
40 // long tv_usec;
41 //} timeval;
42 
43 static int gettimeofday(timeval * tp, struct timezone * tzp)
44 {
45  static const uint64_t EPOCH = ((uint64_t)116444736000000000ULL);
46 
47  SYSTEMTIME system_time;
48  FILETIME file_time;
49  uint64_t time;
50 
51  GetSystemTime(&system_time);
52  SystemTimeToFileTime(&system_time, &file_time);
53  time = ((uint64_t)file_time.dwLowDateTime);
54  time += ((uint64_t)file_time.dwHighDateTime) << 32;
55 
56  tp->tv_sec = (long)((time - EPOCH) / 10000000L);
57  tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
58  return 0;
59 }