Skip to content

Commit

Permalink
include: posix: add c++ extern scope
Browse files Browse the repository at this point in the history
`<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]>
  • Loading branch information
cfriedt committed Jan 16, 2023
1 parent 6fd104c commit 759dc8d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/zephyr/posix/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@
#define F_GETFL 3
#define F_SETFL 4

#ifdef __cplusplus
extern "C" {
#endif

int open(const char *name, int flags, ...);
int fcntl(int fildes, int cmd, ...);

#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_POSIX_FCNTL_H_ */
8 changes: 8 additions & 0 deletions include/zephyr/posix/net/if.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@

#include <zephyr/net/socket.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_INCLUDE_POSIX_NET_IF_H_ */
8 changes: 8 additions & 0 deletions include/zephyr/posix/netinet/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@

#include <zephyr/net/socket.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_INCLUDE_POSIX_NETINET_TCP_H_ */

0 comments on commit 759dc8d

Please sign in to comment.