vxworks compatibility additions

This commit is contained in:
lchristina26
2015-09-29 12:12:35 -06:00
parent 797bcb6340
commit 3c2712da31
3 changed files with 25 additions and 2 deletions

View File

@ -79,6 +79,9 @@
#include <sys/socket.h>
#elif defined(WOLFSSL_IAR_ARM)
/* nothing */
#elif defined(WOLFSSL_VXWORKS)
#include <sockLib.h>
#include <errno.h>
#else
#include <sys/types.h>
#include <errno.h>

View File

@ -49,6 +49,19 @@
char **h_addr_list; /* list of addresses from name server */
};
#define SOCKET_T int
#elif defined(WOLFSSL_VXWORKS)
#include <hostLib.h>
#include <sockLib.h>
#include <arpa/inet.h>
#include <string.h>
#include <selectLib.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <sys/time.h>
#include <netdb.h>
#include <pthread.h>
#define SOCKET_T int
#else
#include <string.h>
#include <sys/types.h>
@ -419,6 +432,8 @@ static INLINE void build_addr(SOCKADDR_IN_T* addr, const char* peer,
struct hostent* entry = gethostbyname(peer, &err);
#elif defined(WOLFSSL_TIRTOS)
struct hostent* entry = DNSGetHostByName(peer);
#elif defined(WOLFSSL_VXWORKS)
struct hostent* entry = (struct hostent*)hostGetByName(peer);
#else
struct hostent* entry = gethostbyname(peer);
#endif
@ -774,7 +789,8 @@ static INLINE void tcp_set_nonblocking(SOCKET_T* sockfd)
int ret = ioctlsocket(*sockfd, FIONBIO, &blocking);
if (ret == SOCKET_ERROR)
err_sys("ioctlsocket failed");
#elif defined(WOLFSSL_MDK_ARM) || defined (WOLFSSL_TIRTOS)
#elif defined(WOLFSSL_MDK_ARM) || defined (WOLFSSL_TIRTOS) \
|| defined(WOLFSSL_VXWORKS)
/* non blocking not suppported, for now */
#else
int flags = fcntl(*sockfd, F_GETFL, 0);

View File

@ -111,7 +111,11 @@
#ifdef _MSC_VER
#define INLINE __inline
#elif defined(__GNUC__)
#define INLINE inline
#ifdef WOLFSSL_VXWORKS
#define INLINE __inline__
#else
#define INLINE inline
#endif
#elif defined(__IAR_SYSTEMS_ICC__)
#define INLINE inline
#elif defined(THREADX)