소스 검색

Fix to compile on IOS

mingodad 9 년 전
부모
커밋
7ad2e5a804
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      SquiLu/sqstdlib/sqstdsystem.cpp

+ 6 - 0
SquiLu/sqstdlib/sqstdsystem.cpp

@@ -367,6 +367,7 @@ static SQRESULT  _system_sleep(HSQUIRRELVM v)
 #ifndef _WIN32_WCE
 #ifndef _WIN32_WCE
 #include <sys/timeb.h>
 #include <sys/timeb.h>
 
 
+#ifndef TARGET_IOS
 static int sqftime(struct timeb *tp)
 static int sqftime(struct timeb *tp)
 {
 {
 	struct timespec ts;
 	struct timespec ts;
@@ -376,6 +377,7 @@ static int sqftime(struct timeb *tp)
 	tp->timezone = tp->dstflag = 0;
 	tp->timezone = tp->dstflag = 0;
 	return 0;
 	return 0;
 }
 }
+#endif
 
 
 
 
 int GetMilliCount()
 int GetMilliCount()
@@ -384,7 +386,11 @@ int GetMilliCount()
   // It rolls over every ~ 12.1 days (0x100000/24/60/60)
   // It rolls over every ~ 12.1 days (0x100000/24/60/60)
   // Use GetMilliSpan to correct for rollover
   // Use GetMilliSpan to correct for rollover
   timeb tb;
   timeb tb;
+#ifndef TARGET_IOS
   sqftime( &tb );
   sqftime( &tb );
+#else
+  ftime( &tb );
+#endif
   int nCount = tb.millitm + (tb.time & 0xfffff) * 1000;
   int nCount = tb.millitm + (tb.time & 0xfffff) * 1000;
   return nCount;
   return nCount;
 }
 }