瀏覽代碼

Include time.h when struct timespec is used

In both the POSIX ( http://pubs.opengroup.org/onlinepubs/009695299/basedefs/time.h.html ) and C11 ( https://en.cppreference.com/w/c/chrono/timespec ) standards, the struct timespec structure is defined in the time.h header. 

Depending on the specific VxWorks version, the time.h header could be already transitively included by one of the other headers, 
but explicitly adding the time.h include makes sure the UA_sleep_ms macro will work correctly on all possible versions.
Silvio Traversaro 5 年之前
父節點
當前提交
ce4a4cbe02
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      arch/vxworks/ua_architecture.h

+ 1 - 0
arch/vxworks/ua_architecture.h

@@ -13,6 +13,7 @@
 #include "ua_architecture_base.h"
 
 #include <errno.h>
+#include <time.h>
 
 #include <arpa/inet.h>
 #include <netinet/in.h>