Initial C++ runtime work. Much more to do.

This commit is contained in:
2015-05-02 23:32:01 -04:00
parent 772476ea85
commit db2bda84c8
35 changed files with 7920 additions and 0 deletions

46
libcpprt.cc Normal file
View File

@ -0,0 +1,46 @@
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()
{
uprintf( "Hello\n" );
if( 1 ) tester= new TestingImpl();
}
void
libcpprt_close()
{
uprintf( "Goodbye\n" );
if( 1 ) delete tester;
}