1 #include "../src/scheme.h"
2 // moved to ucs4string.cpp for Mingw.
3 // #include <map>
4 // #include <list>
5 // #include <vector>
6 // const ucs4char* UC(const char *str)
7 // {
8 // 	typedef std::map<const char *, ucs4char*> Hash;
9 // 	typedef std::list<std::vector<ucs4char> > Data;
10 // 	static Hash hash;
11 // 	static Data data;
12 // 	Hash::iterator i = hash.find(str);
13 // 	if (i == hash.end()) {
14 // 		size_t len = strlen(str);
15 // 		data.push_back(std::vector<ucs4char>());
16 // 		std::vector<ucs4char>& d = data.back();
17 // 		d.resize(len + 1);
18 // 		for (size_t i = 0; i < len; i++) {
19 // 			d[i] = str[i];
20 // 		}
21 // 		d[len] = 0;
22 // 		hash[str] = &d[0];
23 // 		return &d[0];
24 // 	} else {
25 // 		return i->second;
26 // 	}
27 // }
28 
29 #ifndef MOSH_MINGW32
30 #include "include/gettimeofday.h"
31 #include <sys/timeb.h>
32 #include <winsock.h> // for timeval
33 
gettimeofday(struct timeval * tv,struct timezone *)34 int gettimeofday(struct timeval *tv, struct timezone *)
35 {
36     struct _timeb timeb;
37     _ftime_s(&timeb);
38     tv->tv_sec = timeb.time;
39     tv->tv_usec = timeb.millitm * 1000;
40 #pragma message("tz is not supported in gettimeofday")
41 	return 0;
42 }
43 #endif
44