diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-08-30 20:13:50 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-08-30 20:13:50 +0000 |
commit | 79c7065433ae27932ad8b781d38b8f7832b01581 (patch) | |
tree | f770414832eeecb35adb70404b31d147afad7235 /apps/examples/helloxx | |
parent | f9d19788072090be80b71ab0d0de14507a6e739b (diff) | |
download | nuttx-79c7065433ae27932ad8b781d38b8f7832b01581.tar.gz nuttx-79c7065433ae27932ad8b781d38b8f7832b01581.tar.bz2 nuttx-79c7065433ae27932ad8b781d38b8f7832b01581.zip |
Add configurable application entry point
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5070 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/helloxx')
-rw-r--r-- | apps/examples/helloxx/main.cxx | 23 |
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 |