Files
libcpp.ko/libcpprt.cc
ADAM David Alan Martin aa17f3857f It seems to link, and I need Unwind now.
I'm too tired to mess with this.  I'll probably break something.
Time to go to bed.
2015-05-03 03:53:52 -04:00

58 lines
653 B
C++

extern "C"
{
#include <sys/param.h>
#include <sys/module.h>
#include <sys/kernel.h>
#include <sys/systm.h>
void libcpprt_entry();
void libcpprt_close();
}
class Testing
{
public:
explicit inline Testing() {}
virtual ~Testing() {}
virtual void core() const= 0;
};
Testing *tester= nullptr;
class TestingImpl : public Testing
{
public:
virtual void
core() const override
{
uprintf( "In impl." );
}
};
void
libcpprt_entry()
try
{
uprintf( "Hello\n" );
tester= new TestingImpl();
tester->core();
}
catch( ... )
{
}
void
libcpprt_close()
try
{
uprintf( "Goodbye\n" );
tester->core();
delete tester;
}
catch( ... )
{
}