diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-05-16 09:36:55 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-05-16 09:36:55 -0600 |
commit | 8103e0321234bec9383d442068a66162e67c2598 (patch) | |
tree | 9e7265ee49152481ea4f341779ddf5742daf6365 /apps/examples/helloxx/helloxx_main.cxx | |
parent | 4e4fe19a8deba9dbb63294bb2ba74a452a663a9f (diff) | |
download | nuttx-8103e0321234bec9383d442068a66162e67c2598.tar.gz nuttx-8103e0321234bec9383d442068a66162e67c2598.tar.bz2 nuttx-8103e0321234bec9383d442068a66162e67c2598.zip |
apps/examples/helloxx entry point name was mangled when built as an NSH builtin; plus some README updates
Diffstat (limited to 'apps/examples/helloxx/helloxx_main.cxx')
-rw-r--r-- | apps/examples/helloxx/helloxx_main.cxx | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/apps/examples/helloxx/helloxx_main.cxx b/apps/examples/helloxx/helloxx_main.cxx index 60fd0487b..eeca52263 100644 --- a/apps/examples/helloxx/helloxx_main.cxx +++ b/apps/examples/helloxx/helloxx_main.cxx @@ -1,7 +1,7 @@ //*************************************************************************** // examples/helloxx/helloxx_main.cxx // -// Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved. +// Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved. // Author: Gregory Nutt <gnutt@nuttx.org> // // Redistribution and use in source and binary forms, with or without @@ -128,38 +128,40 @@ static CHelloWorld g_HelloWorld; * Name: helloxx_main ****************************************************************************/ -int helloxx_main(int argc, char *argv[]) +extern "C" { - // If C++ initialization for static constructors is supported, then do - // that first + int helloxx_main(int argc, char *argv[]) + { + // If C++ initialization for static constructors is supported, then do + // that first #ifdef CONFIG_HAVE_CXXINITIALIZE - up_cxxinitialize(); + up_cxxinitialize(); #endif - // Exercise an explictly instantiated C++ object + // Exercise an explictly instantiated C++ object - CHelloWorld *pHelloWorld = new CHelloWorld; - printf("helloxx_main: Saying hello from the dynamically constructed instance\n"); - pHelloWorld->HelloWorld(); + CHelloWorld *pHelloWorld = new CHelloWorld; + printf("helloxx_main: Saying hello from the dynamically constructed instance\n"); + pHelloWorld->HelloWorld(); - // Exercise an C++ object instantiated on the stack + // Exercise an C++ object instantiated on the stack #ifndef CONFIG_EXAMPLES_HELLOXX_NOSTACKCONST - CHelloWorld HelloWorld; + CHelloWorld HelloWorld; - printf("helloxx_main: Saying hello from the instance constructed on the stack\n"); - HelloWorld.HelloWorld(); + printf("helloxx_main: Saying hello from the instance constructed on the stack\n"); + HelloWorld.HelloWorld(); #endif - // Exercise an statically constructed C++ object + // Exercise an statically constructed C++ object #ifdef CONFIG_HAVE_CXXINITIALIZE - printf("helloxx_main: Saying hello from the statically constructed instance\n"); - g_HelloWorld.HelloWorld(); + printf("helloxx_main: Saying hello from the statically constructed instance\n"); + g_HelloWorld.HelloWorld(); #endif - delete pHelloWorld; - return 0; + delete pHelloWorld; + return 0; + } } - |