From a65076aae3243584fae5a6944a16a3d926a30062 Mon Sep 17 00:00:00 2001 From: stijn Date: Wed, 24 Apr 2024 14:17:55 +0200 Subject: [PATCH] examples/usercmodule: Include API headers in the C++ example. Make the CI builds compile the public API as C++ to catch accidental introductions of incompatible code. Signed-off-by: stijn --- examples/usercmodule/cppexample/example.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/examples/usercmodule/cppexample/example.cpp b/examples/usercmodule/cppexample/example.cpp index 2df832baa7..7fd8642f43 100644 --- a/examples/usercmodule/cppexample/example.cpp +++ b/examples/usercmodule/cppexample/example.cpp @@ -1,6 +1,22 @@ extern "C" { #include +// Include the public API. This is only here to verify everything compiles as C++, +// an actual application should only include what is needed. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include // Here we implement the function using C++ code, but since it's // declaration has to be compatible with C everything goes in extern "C" scope.