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 <stijn@ignitron.net>
pull/14370/head
stijn 2024-04-24 14:17:55 +02:00
rodzic 9c7f0659e2
commit a65076aae3
1 zmienionych plików z 16 dodań i 0 usunięć

Wyświetl plik

@ -1,6 +1,22 @@
extern "C" {
#include <examplemodule.h>
// Include the public API. This is only here to verify everything compiles as C++,
// an actual application should only include what is needed.
#include <py/gc.h>
#include <py/obj.h>
#include <py/objarray.h>
#include <py/objexcept.h>
#include <py/objfun.h>
#include <py/objgenerator.h>
#include <py/objint.h>
#include <py/objlist.h>
#include <py/objmodule.h>
#include <py/objnamedtuple.h>
#include <py/objstr.h>
#include <py/objstringio.h>
#include <py/objtuple.h>
#include <py/objtype.h>
#include <py/runtime.h>
// 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.