Leon Urbas преди 11 години
родител
ревизия
0377596ee5
променени са 1 файла, в които са добавени 3 реда и са изтрити 8 реда
  1. 3 8
      src/opcua_time.c

+ 3 - 8
src/opcua_time.c

@@ -9,20 +9,16 @@
  */
 #include "opcua_builtInDatatypes.h"
 #include "opcua_advancedDatatypes.h"
-#include <time.h>
-#include <assert.h>
-#include <errno.h>
-#include <stdarg.h>
+#include <sys/time.h>
 
-// number of seconds from 1 Jan. 1601 00:00 to 1 Jan 1970 00:00 UTC
+// Number of seconds from 1 Jan. 1601 00:00 to 1 Jan 1970 00:00 UTC
 #define FILETIME_UNIXTIME_BIAS_SEC 11644473600LL
-//
+// Factors
 #define HUNDRED_NANOSEC_PER_USEC 10LL
 #define HUNDRED_NANOSEC_PER_SEC (HUNDRED_NANOSEC_PER_USEC * 1000000LL)
 
 // IEC 62541-6 §5.2.2.5  A DateTime value shall be encoded as a 64-bit signed integer
 // which represents the number of 100 nanosecond intervals since January 1, 1601 (UTC).
-
 UA_DateTime opcua_getTime() {
 	UA_DateTime dateTime;
 	struct timeval tv;
@@ -31,4 +27,3 @@ UA_DateTime opcua_getTime() {
 			* HUNDRED_NANOSEC_PER_SEC + tv.tv_usec * HUNDRED_NANOSEC_PER_USEC;
 	return dateTime;
 }
-