summaryrefslogblamecommitdiff
path: root/src/user/lib/fwik/main.cpp
blob: e26cb46447acedf7399afb0bc00a0bde26b6ea84 (plain) (tree)
1
2
3
4
5
6
7
8


                        
                   


               
                                        







                                            






                                                           













                                                                             
#include <IO/IOStream.h>
#include <stdio.h>
#include <cpp.h>
#include <String.h>

IOStream stdio;

int Main(String *args);	// FWIK app main

extern "C" int main(char **args) {
	stdio.term = 0;

	Node zero(libc::term);
	if (zero.info.type & FT_TERMINAL) {
		stdio.term = new Term(zero);
	}
	
	int argc = 0;
	while (args[argc] != 0) argc++;
	String s_args[argc+1];
	for (int i = 0; i < argc; i++) s_args[i] = args[i];

	Main(s_args);
}


// C++ support

//Enables pure virtual functions
extern "C" void __cxa_pure_virtual() {
	//do nothing
}
//Enables global objects
void *__dso_handle;
extern "C" int __cxa_atexit(void (*f)(void*), void *p, void *d) { return 0; }