mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-17 05:19:05 +03:00
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:
1 parent
7dff177f29
commit
ea01661faf
68 files changed
+582
-29
No files matched your search
@@ -0,0 +1,21 @@
|
||||
#include <zephyr/logging/log.h>
|
||||
LOG_MODULE_REGISTER(coap_cpp_test, LOG_LEVEL_DBG);
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <errno.h>
|
||||
#include "coap3/coap.h"
|
||||
#include <stdio.h>
|
||||
|
||||
coap_str_const_t *xxx_libcoap_get_version() {
|
||||
coap_str_const_t *ver;
|
||||
|
||||
ver = coap_make_str_const(LIBCOAP_PACKAGE_VERSION);
|
||||
printf("Version: %s\n", ver->s);
|
||||
return ver;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
xxx_libcoap_get_version();
|
||||
exit(0);
|
||||
}
|
||||
Reference in new issue
Block a user