Skip to content

Commit 21e025e

Browse files
aescolarrlubos
authored andcommitted
[nrf fromtree] net: sockets_offload: Fix build error with NO_OPTIMIZATIONS
When CONFIG_NO_OPTIMIZATIONS the compiler will not inline socket_offload_dns_is_enabled(), which means calls to socket_offload* remain, and the linker will fail with in function `zsock_getaddrinfo': undefined reference to `socket_offload_getaddrinfo' in function `zsock_freeaddrinfo': undefined reference to `socket_offload_freeaddrinfo' Instead of relaying on that function being inlined and the if'ed code being removed, let's just use the preprocessor. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no> (cherry picked from commit dc24583858b68c1119d99e03c410db53a8b04335) Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
1 parent 0b4a918 commit 21e025e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

include/zephyr/net/socket_offload.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,7 @@ void socket_offload_dns_enable(bool enable);
6767
#if defined(CONFIG_NET_SOCKETS_OFFLOAD)
6868
bool socket_offload_dns_is_enabled(void);
6969
#else
70-
static inline bool socket_offload_dns_is_enabled(void)
71-
{
72-
return false;
73-
}
70+
#define socket_offload_dns_is_enabled() false
7471
#endif /* defined(CONFIG_NET_SOCKETS_OFFLOAD) */
7572

7673

0 commit comments

Comments
 (0)