From fafd67fe82f0180fb3353787b8ac7d025a028e82 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 28 Feb 2012 23:38:59 +0000 Subject: [PATCH] Add logic to NSH startup to call C++ static initializers on startup git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4439 42af7a65-404d-4744-a932-0658087f49c3 --- ChangeLog.txt | 2 ++ examples/nsh/nsh_main.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 8c4fdd4df..8317f2532 100755 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -198,3 +198,5 @@ keyboard mappings of the Backspace key. Submitted by Mike Smith. * apps/examples/cdcacm: An example that illustrates how the CDC/ACM driver may to connected and disconnected through software control. + * apps/examples/nsh/nsh_main.c: If available, call up_cxxinitialize() to + initialize all statically defined C++ classes. diff --git a/examples/nsh/nsh_main.c b/examples/nsh/nsh_main.c index 5d302e397..1d1592b4d 100644 --- a/examples/nsh/nsh_main.c +++ b/examples/nsh/nsh_main.c @@ -45,6 +45,8 @@ #include #include +#include + #include /**************************************************************************** @@ -84,6 +86,12 @@ int user_start(int argc, char *argv[]) int exitval = 0; int ret; + /* Call all C++ static constructors */ + +#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE) + up_cxxinitialize(); +#endif + /* Initialize the NSH library */ nsh_initialize();