ua_architecture.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* This work is licensed under a Creative Commons CCZero 1.0 Universal License.
  2. * See http://creativecommons.org/publicdomain/zero/1.0/ for more information.
  3. *
  4. * Copyright 2016-2017 (c) Julius Pfrommer, Fraunhofer IOSB
  5. * Copyright 2017 (c) Stefan Profanter, fortiss GmbH
  6. */
  7. #ifndef PLUGINS_ARCH_VXWORKS_UA_ARCHITECTURE_H_
  8. #define PLUGINS_ARCH_VXWORKS_UA_ARCHITECTURE_H_
  9. #include <../deps/queue.h> //in some compilers there's already a _SYS_QUEUE_H_ who is included first and doesn't have all functions
  10. #include <errno.h>
  11. #define CLOSESOCKET(S) close(S)
  12. #include <arpa/inet.h>
  13. #include <netinet/in.h>
  14. #include <netdb.h>
  15. #include <sys/ioctl.h>
  16. #include <hostLib.h>
  17. #include <selectLib.h>
  18. #define UA_sleep_ms(X) \
  19. { \
  20. struct timespec timeToSleep; \
  21. timeToSleep.tv_sec = X / 1000; \
  22. timeToSleep.tv_nsec = 1000000 * (X % 1000); \
  23. nanosleep(&timeToSleep, NULL); \
  24. }
  25. #define SOCKET int
  26. #define WIN32_INT
  27. #define OPTVAL_TYPE int
  28. #define ERR_CONNECTION_PROGRESS EINPROGRESS
  29. #include <fcntl.h>
  30. #include <unistd.h> // read, write, close
  31. #include <netinet/tcp.h>
  32. #define UA_fd_set(fd, fds) FD_SET((unsigned int)fd, fds)
  33. #define UA_fd_isset(fd, fds) FD_ISSET((unsigned int)fd, fds)
  34. #define errno__ errno
  35. #define INTERRUPTED EINTR
  36. #define WOULDBLOCK EWOULDBLOCK
  37. #define AGAIN EAGAIN
  38. #endif /* PLUGINS_ARCH_VXWORKS_UA_ARCHITECTURE_H_ */