aboutsummaryrefslogtreecommitdiff
path: root/apps/examples/helloxx/main.cxx
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-30 20:13:50 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-08-30 20:13:50 +0000
commitb121fbbb00aa877caef26e5ffb14b3687d36827f (patch)
treef770414832eeecb35adb70404b31d147afad7235 /apps/examples/helloxx/main.cxx
parent6ab6c46f2f29d82707bc7c3aae3ec5283bd285aa (diff)
downloadpx4-firmware-b121fbbb00aa877caef26e5ffb14b3687d36827f.tar.gz
px4-firmware-b121fbbb00aa877caef26e5ffb14b3687d36827f.tar.bz2
px4-firmware-b121fbbb00aa877caef26e5ffb14b3687d36827f.zip
Add configurable application entry point
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5070 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'apps/examples/helloxx/main.cxx')
-rw-r--r--apps/examples/helloxx/main.cxx23
1 files changed, 5 insertions, 18 deletions
diff --git a/apps/examples/helloxx/main.cxx b/apps/examples/helloxx/main.cxx
index 8514fead2..fcec7c761 100644
--- a/apps/examples/helloxx/main.cxx
+++ b/apps/examples/helloxx/main.cxx
@@ -124,24 +124,11 @@ static CHelloWorld g_HelloWorld;
// Public Functions
//***************************************************************************
-//***************************************************************************
-// user_start
-//***************************************************************************
-
/****************************************************************************
- * Name: user_start/nxhello_main
+ * Name: helloxx_main
****************************************************************************/
-#ifdef CONFIG_EXAMPLES_HELLOXX_BUILTIN
-extern "C" int helloxx_main(int argc, char *argv[]);
-# define MAIN_NAME helloxx_main
-# define MAIN_STRING "helloxx_main: "
-#else
-# define MAIN_NAME user_start
-# define MAIN_STRING "user_start: "
-#endif
-
-int MAIN_NAME(int argc, char *argv[])
+int helloxx_main(int argc, char *argv[])
{
// If C++ initialization for static constructors is supported, then do
// that first
@@ -153,7 +140,7 @@ int MAIN_NAME(int argc, char *argv[])
// Exercise an explictly instantiated C++ object
CHelloWorld *pHelloWorld = new CHelloWorld;
- printf(MAIN_STRING "Saying hello from the dynamically constructed instance\n");
+ printf("helloxx_main: Saying hello from the dynamically constructed instance\n");
pHelloWorld->HelloWorld();
// Exercise an C++ object instantiated on the stack
@@ -161,14 +148,14 @@ int MAIN_NAME(int argc, char *argv[])
#ifndef CONFIG_EXAMPLES_HELLOXX_NOSTACKCONST
CHelloWorld HelloWorld;
- printf(MAIN_STRING "Saying hello from the instance constructed on the stack\n");
+ printf("helloxx_main: Saying hello from the instance constructed on the stack\n");
HelloWorld.HelloWorld();
#endif
// Exercise an statically constructed C++ object
#ifdef CONFIG_HAVE_CXXINITIALIZE
- printf(MAIN_STRING "Saying hello from the statically constructed instance\n");
+ printf("helloxx_main: Saying hello from the statically constructed instance\n");
g_HelloWorld.HelloWorld();
#endif