|
|
@@ -3,26 +3,6 @@
|
|
|
#include <stdio.h>
|
|
|
#include <string.h>
|
|
|
|
|
|
-#include "hplatform.h"
|
|
|
-
|
|
|
-void msleep(unsigned long ms) {
|
|
|
-#ifdef OS_WIN
|
|
|
- Sleep(ms);
|
|
|
-#else
|
|
|
- usleep(ms*1000);
|
|
|
-#endif
|
|
|
-}
|
|
|
-
|
|
|
-uint64 gettick() {
|
|
|
-#ifdef OS_WIN
|
|
|
- return GetTickCount();
|
|
|
-#else
|
|
|
- struct timeval tv;
|
|
|
- gettimeofday(&tv, NULL);
|
|
|
- return tv.tv_sec*1000 + tv.tv_usec/1000;
|
|
|
-#endif
|
|
|
-}
|
|
|
-
|
|
|
datetime_t get_datetime() {
|
|
|
datetime_t dt;
|
|
|
#ifdef OS_WIN
|
|
|
@@ -57,7 +37,7 @@ static const char* s_month[] = {"January", "February", "March", "April", "May",
|
|
|
"July", "August", "September", "October", "November", "December"};
|
|
|
|
|
|
int month_atoi(const char* month) {
|
|
|
- for (size_t i = 0; i < ARRAY_SIZE(s_month); ++i) {
|
|
|
+ for (size_t i = 0; i < 12; ++i) {
|
|
|
if (strnicmp(month, s_month[i], strlen(month)) == 0)
|
|
|
return i+1;
|
|
|
}
|