From 2f58ada8d147251e7781df02d6a5fa7cb503107e Mon Sep 17 00:00:00 2001 From: heck Date: Fri, 16 Dec 2022 01:19:29 +0100 Subject: [PATCH] Add first C++ module --- src/ext.cc | 13 +++++++++++++ src/ext.hh | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/ext.cc create mode 100644 src/ext.hh diff --git a/src/ext.cc b/src/ext.cc new file mode 100644 index 0000000..561aeaa --- /dev/null +++ b/src/ext.cc @@ -0,0 +1,13 @@ +#include "ext.hh" +#include + +namespace Orca { + int counter{ 0 }; +} + +void test_cxx(Glyph* gbuf, Mark* mbuf, Usz height, Usz width, Usz tick_number) +{ + Orca::counter++; + std::cout << "test_cxx()" << Orca::counter << std::endl; +} + diff --git a/src/ext.hh b/src/ext.hh new file mode 100644 index 0000000..e1f299a --- /dev/null +++ b/src/ext.hh @@ -0,0 +1,24 @@ +// This file is under GNU General Public License 3.0 +// see LICENSE.txt +// clang-format off +#ifndef ORCA_EXT_HH +#define ORCA_EXT_HH +#include "base.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test_cxx(Glyph * gbuf, +Mark * mbuf, +Usz height, +Usz width, +Usz tick_number); + + + +#ifdef __cplusplus +}; +#endif + +#endif //ORCA_EXT_HH \ No newline at end of file