From 3c2712da312fa13d23ecb1f838abc7e6da44cfba Mon Sep 17 00:00:00 2001 From: lchristina26 Date: Tue, 29 Sep 2015 12:12:35 -0600 Subject: [PATCH 1/2] vxworks compatibility additions --- src/io.c | 3 +++ wolfssl/test.h | 18 +++++++++++++++++- wolfssl/wolfcrypt/types.h | 6 +++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/io.c b/src/io.c index e296a2ed9..5ca5ce103 100644 --- a/src/io.c +++ b/src/io.c @@ -79,6 +79,9 @@ #include #elif defined(WOLFSSL_IAR_ARM) /* nothing */ + #elif defined(WOLFSSL_VXWORKS) + #include + #include #else #include #include diff --git a/wolfssl/test.h b/wolfssl/test.h index add257133..d247f7c73 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -49,6 +49,19 @@ char **h_addr_list; /* list of addresses from name server */ }; #define SOCKET_T int +#elif defined(WOLFSSL_VXWORKS) + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #define SOCKET_T int #else #include #include @@ -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); diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index dfe15d488..a4f10ffd7 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -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) From 7c9490844a54c787ccb09296863104d0a153c774 Mon Sep 17 00:00:00 2001 From: lchristina26 Date: Tue, 29 Sep 2015 12:22:03 -0600 Subject: [PATCH 2/2] fix formatting for vxworks commits --- src/io.c | 6 +++--- wolfssl/wolfcrypt/types.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/io.c b/src/io.c index 5ca5ce103..9752bcd80 100644 --- a/src/io.c +++ b/src/io.c @@ -79,9 +79,9 @@ #include #elif defined(WOLFSSL_IAR_ARM) /* nothing */ - #elif defined(WOLFSSL_VXWORKS) - #include - #include + #elif defined(WOLFSSL_VXWORKS) + #include + #include #else #include #include diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index a4f10ffd7..b9c721fbf 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -111,11 +111,11 @@ #ifdef _MSC_VER #define INLINE __inline #elif defined(__GNUC__) - #ifdef WOLFSSL_VXWORKS - #define INLINE __inline__ - #else - #define INLINE inline - #endif + #ifdef WOLFSSL_VXWORKS + #define INLINE __inline__ + #else + #define INLINE inline + #endif #elif defined(__IAR_SYSTEMS_ICC__) #define INLINE inline #elif defined(THREADX)