Zephyr: Support C++ builds

Some of the Zephyr include files need to be C++, not C based. The 'extern "C"'
wrapper in include/coap3/coap.h means that all #include are treated as being C.

Remove 'extern "C"' wrapper from include/coap3/coap.h and add wrapper to
include files after #include and before any function / structure definitions.

Add in a C++ build test for CI.
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2025-08-21 12:17:41 +01:00
1 parent 7dff177f29
commit ea01661faf
68 files changed
+582 -29

No files matched your search

+10 -2
View File
@@ -24,6 +24,12 @@
* @{
*/
#include "coap_pdu.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef COAP_DEBUG_FD
/**
* Used for output for @c COAP_LOG_OSCORE to @c COAP_LOG_ERR.
@@ -303,8 +309,6 @@ void coap_print_contiki_prefix(coap_log_t level);
} while(0)
#endif
#include "coap_pdu.h"
/**
* Defines the output mode for the coap_show_pdu() function.
*
@@ -404,4 +408,8 @@ const char *coap_print_ip_addr(const coap_address_t *address,
*/
int coap_debug_set_packet_loss(const char *loss_level);
#ifdef __cplusplus
}
#endif
#endif /* COAP_DEBUG_H_ */