Bläddra i källkod

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 6 år sedan
förälder
incheckning
ce4a4cbe02
1 ändrade filer med 1 tillägg och 0 borttagningar
  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>