File tree Expand file tree Collapse file tree 9 files changed +91
-0
lines changed Expand file tree Collapse file tree 9 files changed +91
-0
lines changed Original file line number Diff line number Diff line change 29
29
30
30
#include < sys/types.h>
31
31
#ifdef HAVE_NETINET_IN_H
32
+ #ifdef __ZEPHYR__
33
+ #include < zephyr/posix/netinet/in.h>
34
+ #else
32
35
#include < netinet/in.h>
33
36
#endif
37
+ #endif
34
38
#ifdef HAVE_INTTYPES_H
35
39
#include < inttypes.h>
36
40
#endif
Original file line number Diff line number Diff line change 35
35
#include < memory>
36
36
37
37
#ifdef HAVE_NETINET_IN_H
38
+ #ifdef __ZEPHYR__
39
+ #include < zephyr/posix/netinet/in.h>
40
+ #else
38
41
#include < netinet/in.h>
39
42
#endif
43
+ #endif
40
44
#include < sys/types.h>
41
45
#include < string>
42
46
#include < map>
Original file line number Diff line number Diff line change 107
107
# define THRIFT_LSEEK lseek
108
108
# define THRIFT_WRITE write
109
109
# define THRIFT_READ read
110
+ int ioctl (int fd , unsigned long request , ...);
110
111
# define THRIFT_IOCTL_SOCKET ioctl
111
112
# define THRIFT_IOCTL_SOCKET_NUM_BYTES_TYPE int
112
113
# define THRIFT_STAT stat
Original file line number Diff line number Diff line change 25
25
#include < thrift/thrift-config.h>
26
26
27
27
#ifdef HAVE_UNISTD_H
28
+ #ifdef __ZEPHYR__
29
+ #include < zephyr/posix/unistd.h>
30
+ #else
28
31
#include < unistd.h>
29
32
#endif
33
+ #endif
30
34
#ifdef HAVE_SYS_UN_H
31
35
#include < sys/un.h>
32
36
#endif
33
37
#ifdef HAVE_AF_UNIX_H
34
38
#include < afunix.h>
35
39
#endif
36
40
#ifdef HAVE_SYS_SOCKET_H
41
+ #ifdef __ZEPHYR__
42
+ #include < zephyr/posix/sys/socket.h>
43
+ #else
37
44
#include < sys/socket.h>
38
45
#endif
46
+ #endif
39
47
40
48
#include < string>
41
49
Original file line number Diff line number Diff line change 24
24
#include < stdexcept>
25
25
#include < sys/types.h>
26
26
#ifdef HAVE_SYS_SOCKET_H
27
+ #ifdef __ZEPHYR__
28
+ #include < zephyr/posix/sys/socket.h>
29
+ #else
27
30
#include < sys/socket.h>
28
31
#endif
32
+ #endif
29
33
#ifdef HAVE_SYS_UN_H
30
34
#include < sys/un.h>
31
35
#endif
32
36
#ifdef HAVE_SYS_POLL_H
33
37
#include < sys/poll.h>
34
38
#endif
35
39
#ifdef HAVE_NETINET_IN_H
40
+ #ifdef __ZEPHYR__
41
+ #include < zephyr/posix/netinet/in.h>
42
+ #include < zephyr/posix/netinet/tcp.h>
43
+ #else
36
44
#include < netinet/in.h>
37
45
#include < netinet/tcp.h>
38
46
#endif
47
+ #endif
39
48
#ifdef HAVE_NETDB_H
49
+ #ifdef __ZEPHYR__
50
+ #include < zephyr/posix/netdb.h>
51
+ #else
40
52
#include < netdb.h>
41
53
#endif
54
+ #endif
42
55
#include < fcntl.h>
43
56
#ifdef HAVE_UNISTD_H
57
+ #ifdef __ZEPHYR__
58
+ #include < zephyr/posix/unistd.h>
59
+ #else
44
60
#include < unistd.h>
45
61
#endif
62
+ #endif
46
63
#ifdef HAVE_SYS_STAT_H
47
64
#include < sys/stat.h>
48
65
#endif
Original file line number Diff line number Diff line change 28
28
29
29
#include < sys/types.h>
30
30
#ifdef HAVE_SYS_SOCKET_H
31
+ #ifdef __ZEPHYR__
32
+ #include < zephyr/posix/sys/socket.h>
33
+ #else
31
34
#include < sys/socket.h>
32
35
#endif
36
+ #endif
33
37
#ifdef HAVE_NETDB_H
38
+ #ifdef __ZEPHYR__
39
+ #include < zephyr/posix/netdb.h>
40
+ #else
34
41
#include < netdb.h>
35
42
#endif
43
+ #endif
36
44
37
45
namespace apache {
38
46
namespace thrift {
Original file line number Diff line number Diff line change 22
22
#include < cstring>
23
23
#include < sstream>
24
24
#ifdef HAVE_SYS_IOCTL_H
25
+ #ifdef __ZEPHYR__
26
+ #include < errno.h>
27
+ #include < zephyr/posix/sys/ioctl.h>
28
+ __attribute__ ((weak))
29
+ int ioctl(int fd, unsigned long request, ...)
30
+ {
31
+ (void )fd;
32
+ (void )request;
33
+ return -ENOSYS;
34
+ }
35
+ #else
25
36
#include < sys/ioctl.h>
37
+ #endif
26
38
#ifdef __sun
27
39
#include < sys/filio.h>
28
40
#endif // __sun
29
41
#endif
30
42
#ifdef HAVE_SYS_SOCKET_H
43
+ #ifdef __ZEPHYR__
44
+ #include < zephyr/posix/sys/socket.h>
45
+ #else
31
46
#include < sys/socket.h>
32
47
#endif
48
+ #endif
33
49
#ifdef HAVE_SYS_UN_H
34
50
#include < sys/un.h>
35
51
#endif
38
54
#endif
39
55
#include < sys/types.h>
40
56
#ifdef HAVE_NETINET_IN_H
57
+ #ifdef __ZEPHYR__
58
+ #include < zephyr/posix/netinet/in.h>
59
+ #include < zephyr/posix/netinet/tcp.h>
60
+ #else
41
61
#include < netinet/in.h>
42
62
#include < netinet/tcp.h>
43
63
#endif
64
+ #endif
44
65
#ifdef HAVE_UNISTD_H
66
+ #ifdef __ZEPHYR__
67
+ #include < zephyr/posix/unistd.h>
68
+ #else
45
69
#include < unistd.h>
46
70
#endif
71
+ #endif
47
72
#include < fcntl.h>
48
73
49
74
#include < thrift/concurrency/Monitor.h>
@@ -457,8 +482,12 @@ void TSocket::local_open() {
457
482
if (
458
483
#ifdef _WIN32
459
484
error == WSANO_DATA
485
+ #else
486
+ #ifdef __ZEPHYR__
487
+ error == DNS_EAI_NODATA
460
488
#else
461
489
error == EAI_NODATA
490
+ #endif
462
491
#endif
463
492
) {
464
493
hints.ai_flags &= ~AI_ADDRCONFIG;
Original file line number Diff line number Diff line change 28
28
#include < thrift/transport/PlatformSocket.h>
29
29
30
30
#ifdef HAVE_ARPA_INET_H
31
+ #ifdef __ZEPHYR__
32
+ #include < zephyr/posix/arpa/inet.h>
33
+ #else
31
34
#include < arpa/inet.h>
32
35
#endif
36
+ #endif
33
37
#ifdef HAVE_SYS_TIME_H
34
38
#include < sys/time.h>
35
39
#endif
36
40
#ifdef HAVE_NETDB_H
41
+ #ifdef __ZEPHYR__
42
+ #include < zephyr/posix/netdb.h>
43
+ #else
37
44
#include < netdb.h>
38
45
#endif
46
+ #endif
39
47
40
48
namespace apache {
41
49
namespace thrift {
Original file line number Diff line number Diff line change 27
27
28
28
#include < sys/types.h>
29
29
#ifdef HAVE_SYS_SOCKET_H
30
+ #ifdef __ZEPHYR__
31
+ #include < zephyr/posix/sys/socket.h>
32
+ #else
30
33
#include < sys/socket.h>
31
34
#endif
35
+ #endif
32
36
#ifdef HAVE_NETDB_H
37
+ #ifdef __ZEPHYR__
38
+ #include < zephyr/posix/netdb.h>
39
+ #else
33
40
#include < netdb.h>
34
41
#endif
42
+ #endif
35
43
36
44
#include < thrift/transport/PlatformSocket.h>
37
45
@@ -111,8 +119,12 @@ struct AddressResolutionHelper {
111
119
#ifdef _WIN32
112
120
} else {
113
121
throw std::system_error{THRIFT_GET_SOCKET_ERROR, std::system_category ()};
122
+ #else
123
+ #ifdef __ZEPHYR__
124
+ } else if (ret == DNS_EAI_SYSTEM) {
114
125
#else
115
126
} else if (ret == EAI_SYSTEM) {
127
+ #endif
116
128
throw std::system_error{THRIFT_GET_SOCKET_ERROR, std::system_category ()};
117
129
} else {
118
130
throw std::system_error{ret, gai_error ()};
You can’t perform that action at this time.
0 commit comments