Issue #20065: socketmodule: Fix build error when AF_CAN is defined without the

proper CAN headers.
parent e716933d
...@@ -1226,7 +1226,7 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto) ...@@ -1226,7 +1226,7 @@ makesockaddr(SOCKET_T sockfd, struct sockaddr *addr, size_t addrlen, int proto)
} }
#endif #endif
#ifdef AF_CAN #ifdef HAVE_LINUX_CAN_H
case AF_CAN: case AF_CAN:
{ {
struct sockaddr_can *a = (struct sockaddr_can *)addr; struct sockaddr_can *a = (struct sockaddr_can *)addr;
...@@ -1654,7 +1654,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args, ...@@ -1654,7 +1654,7 @@ getsockaddrarg(PySocketSockObject *s, PyObject *args,
} }
#endif #endif
#ifdef AF_CAN #ifdef HAVE_LINUX_CAN_H
case AF_CAN: case AF_CAN:
switch (s->sock_proto) { switch (s->sock_proto) {
case CAN_RAW: case CAN_RAW:
...@@ -1859,7 +1859,7 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret) ...@@ -1859,7 +1859,7 @@ getsockaddrlen(PySocketSockObject *s, socklen_t *len_ret)
} }
#endif #endif
#ifdef AF_CAN #ifdef HAVE_LINUX_CAN_H
case AF_CAN: case AF_CAN:
{ {
*len_ret = sizeof (struct sockaddr_can); *len_ret = sizeof (struct sockaddr_can);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment