summaryrefslogtreecommitdiff
path: root/mk/symbian/ecrt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mk/symbian/ecrt.cpp')
-rw-r--r--mk/symbian/ecrt.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/mk/symbian/ecrt.cpp b/mk/symbian/ecrt.cpp
new file mode 100644
index 0000000..7d5e5d6
--- /dev/null
+++ b/mk/symbian/ecrt.cpp
@@ -0,0 +1,31 @@
+/**
+ * @file ecrt.cpp ECRT wrapper for Symbian OS
+ *
+ * Copyright (C) 2010 Creytiv.com
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <e32base.h>
+#include <e32cons.h>
+#include <sys/reent.h>
+
+_LIT(KAppName, "baresip");
+extern "C" int main(int argc, char** argv);
+
+
+TInt E32Main()
+{
+ __UHEAP_MARK;
+ CTrapCleanup* cleanup = CTrapCleanup::New();
+ int ret = 0;
+ TRAPD(err, ret = main(0, NULL));
+ if (err)
+ printf("main left with error %d\n", err);
+ if (ret)
+ printf("main returned %d\n", ret);
+ __ASSERT_ALWAYS(!err, User::Panic(KAppName, err));
+ CloseSTDLIB();
+ delete cleanup;
+ __UHEAP_MARKEND;
+ return err;
+}