Skip to content

Commit 7f192c3

Browse files
cfriedtmbolivar-nordic
authored andcommitted
include: posix: add c++ extern scope
`<fcntl.h>`, `<net/if.h>`, and `<netinet/tcp.h>` were missing `extern "C" { .. }"` which is required to avoid C++ name mangling. Signed-off-by: Chris Friedt <[email protected]>
1 parent c2a62f4 commit 7f192c3

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

include/zephyr/posix/fcntl.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@
2727
#define F_GETFL 3
2828
#define F_SETFL 4
2929

30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
33+
3034
int open(const char *name, int flags, ...);
3135
int fcntl(int fildes, int cmd, ...);
3236

37+
#ifdef __cplusplus
38+
}
39+
#endif
40+
3341
#endif /* ZEPHYR_POSIX_FCNTL_H_ */

include/zephyr/posix/net/if.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@
88

99
#include <zephyr/net/socket.h>
1010

11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
#ifdef __cplusplus
16+
}
17+
#endif
18+
1119
#endif /* ZEPHYR_INCLUDE_POSIX_NET_IF_H_ */

include/zephyr/posix/netinet/tcp.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@
88

99
#include <zephyr/net/socket.h>
1010

11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
#ifdef __cplusplus
16+
}
17+
#endif
18+
1119
#endif /* ZEPHYR_INCLUDE_POSIX_NETINET_TCP_H_ */

0 commit comments

Comments
 (0)