Skip to content

Commit a59080a

Browse files
authored
Merge pull request #7288 from bandi13/fixNETDB_H
Move netdb.h and ioctl.h into wolfio.c
2 parents cf733c3 + 897a841 commit a59080a

2 files changed

Lines changed: 48 additions & 8 deletions

File tree

src/wolfio.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,54 @@
4141
#include <wolfssl/error-ssl.h>
4242
#include <wolfssl/wolfio.h>
4343

44+
#ifndef USE_WINDOWS_API
45+
#if defined(WOLFSSL_LWIP) && !defined(WOLFSSL_APACHE_MYNEWT)
46+
#elif defined(ARDUINO)
47+
#elif defined(FREESCALE_MQX)
48+
#elif defined(FREESCALE_KSDK_MQX)
49+
#elif (defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET))
50+
#elif defined(WOLFSSL_CMSIS_RTOS)
51+
#elif defined(WOLFSSL_CMSIS_RTOSv2)
52+
#elif defined(WOLFSSL_TIRTOS)
53+
#elif defined(FREERTOS_TCP)
54+
#elif defined(WOLFSSL_IAR_ARM)
55+
#elif defined(HAVE_NETX_BSD)
56+
#elif defined(WOLFSSL_VXWORKS)
57+
#elif defined(WOLFSSL_NUCLEUS_1_2)
58+
#elif defined(WOLFSSL_LINUXKM)
59+
/* the requisite linux/net.h is included in wc_port.h, with incompatible warnings masked out. */
60+
#elif defined(WOLFSSL_ATMEL)
61+
#elif defined(INTIME_RTOS)
62+
#include <netdb.h>
63+
#elif defined(WOLFSSL_PRCONNECT_PRO)
64+
#include <netdb.h>
65+
#include <sys/ioctl.h>
66+
#elif defined(WOLFSSL_SGX)
67+
#elif defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP)
68+
#elif defined(WOLFSSL_DEOS)
69+
#elif defined(WOLFSSL_ZEPHYR)
70+
#elif defined(MICROCHIP_PIC32)
71+
#elif defined(HAVE_NETX)
72+
#elif defined(FUSION_RTOS)
73+
#elif !defined(WOLFSSL_NO_SOCK)
74+
#if defined(HAVE_RTP_SYS)
75+
#elif defined(EBSNET)
76+
#elif defined(NETOS)
77+
#elif !defined(DEVKITPRO) && !defined(WOLFSSL_PICOTCP) \
78+
&& !defined(WOLFSSL_CONTIKI) && !defined(WOLFSSL_WICED) \
79+
&& !defined(WOLFSSL_GNRC) && !defined(WOLFSSL_RIOT_OS)
80+
#include <netdb.h>
81+
#ifdef __PPU
82+
#include <netex/errno.h>
83+
#else
84+
#include <sys/ioctl.h>
85+
#endif
86+
#endif
87+
#endif
88+
89+
#endif /* USE_WINDOWS_API */
90+
91+
4492
#if defined(HAVE_HTTP_CLIENT)
4593
#include <stdlib.h> /* strtol() */
4694
#endif

wolfssl/wolfio.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@
120120
#include <errno.h>
121121
#include <unistd.h>
122122
#include <fcntl.h>
123-
#include <netdb.h>
124-
#include <sys/ioctl.h>
125123
#elif defined(WOLFSSL_SGX)
126124
#include <errno.h>
127125
#elif defined(WOLFSSL_APACHE_MYNEWT) && !defined(WOLFSSL_LWIP)
@@ -163,15 +161,9 @@
163161
#include <sys/socket.h>
164162
#include <arpa/inet.h>
165163
#include <netinet/in.h>
166-
#ifdef HAVE_NETDB_H
167-
#include <netdb.h>
168-
#endif
169164
#ifdef __PPU
170165
#include <netex/errno.h>
171166
#else
172-
#ifdef HAVE_SYS_IOCTL_H
173-
#include <sys/ioctl.h>
174-
#endif
175167
#endif
176168
#endif
177169
#endif

0 commit comments

Comments
 (0)