Procházet zdrojové kódy

Possible fix for linux gettimeofday build problem.

Mark Sibly před 9 roky
rodič
revize
7b459f6d47

+ 1 - 1
modules/libc/libc.monkey2

@@ -109,7 +109,7 @@ Function time:time_t( timer:time_t Ptr )
 Function localtime:tm_t Ptr( timer:time_t Ptr )
 Function gmtime:tm_t Ptr( timer:time_t Ptr )
 Function difftime:Double( endtime:time_t,starttime:time_t ) 
-Function gettimeofday:Int( tv:timeval Ptr,tz:timezone Ptr )
+Function gettimeofday:Int( tv:timeval Ptr )="gettimeofday_"
 
 '***** unistd.h *****
 

+ 4 - 0
modules/libc/native/libc.cpp

@@ -57,3 +57,7 @@ int mkdir_( const char *path,int mode ){
 	return mkdir( path,0777 );
 #endif
 }
+
+int gettimeofday_( timeval *tv ){
+	return gettimeofday( tv,0 );
+}

+ 3 - 2
modules/libc/native/libc.h

@@ -18,12 +18,13 @@
 #include <unistd.h>
 #endif
 
+typedef struct tm tm_t;
+
 typedef struct stat stat_t;
 
 int system_( const char *command );
 void setenv_( const char *name,const char *value,int overwrite );
 int mkdir_( const char *path,int mode );
-
-typedef struct tm tm_t;
+int gettimeofday_( timeval *tv );
 
 #endif

+ 1 - 1
modules/std/misc/time.monkey2

@@ -113,7 +113,7 @@ End
 #end
 Function Microsecs:Long()
 	Local tv:timeval
-	gettimeofday( Varptr tv,Null )
+	gettimeofday( Varptr tv )
 	Local us:=tv.tv_sec*1000000+tv.tv_usec
 	If _us0 Return us-_us0
 	_us0=us