Port libc-based "fat" Ada runtime
This commit is contained in:
committed by
Norman Feske
parent
dc2786dfb1
commit
e0a0d07cb3
37
include/ada/component.h
Normal file
37
include/ada/component.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef _INCLUDE__ADA__COMPONENT_H_
|
||||
#define _INCLUDE__ADA__COMPONENT_H_
|
||||
|
||||
#include <libc/component.h>
|
||||
|
||||
namespace Ada { namespace Component {
|
||||
/**
|
||||
* Run ada main program
|
||||
*/
|
||||
void main(void);
|
||||
} }
|
||||
|
||||
namespace Libc { namespace Component {
|
||||
|
||||
extern "C" void adainit(void);
|
||||
extern "C" void adafinal(void);
|
||||
|
||||
extern "C" void __gnat_runtime_initialize(void) { };
|
||||
extern "C" void __gnat_runtime_finalize(void) { };
|
||||
extern "C" int gnat_exit_status;
|
||||
|
||||
/**
|
||||
* Construct component
|
||||
*
|
||||
* \param env extended interface to the component's execution environment
|
||||
*/
|
||||
void construct(Libc::Env &env) {
|
||||
Libc::with_libc([&] () {
|
||||
adainit();
|
||||
Ada::Component::main();
|
||||
adafinal();
|
||||
});
|
||||
env.parent().exit(gnat_exit_status);
|
||||
}
|
||||
} }
|
||||
|
||||
#endif /* _INCLUDE__ADA__COMPONENT_H_ */
|
||||
Reference in New Issue
Block a user