[rtems-graphics-toolkit commit] Modified tests to use a wrapper file( function) on linkage

Gedare Bloom gedare at rtems.org
Tue Dec 24 15:24:15 UTC 2013


Module:    rtems-graphics-toolkit
Branch:    master
Commit:    a2d9dfc7af9bf59117cbeaff030756c8ea5dc9e0
Changeset: http://git.rtems.org/rtems-graphics-toolkit/commit/?id=a2d9dfc7af9bf59117cbeaff030756c8ea5dc9e0

Author:    Alexandru-Sever Horin <alex.sever.h at gmail.com>
Date:      Thu Aug  9 16:11:37 2012 +0300

Modified tests to use a wrapper file(function) on linkage

---

 fltk-1.3.0/rtems_main.cxx    |   25 +++++++++++++++++++++++++
 fltk-1.3.0/test/Makefile     |    2 +-
 fltk-1.3.0/test/blocks.cxx   |    2 +-
 fltk-1.3.0/test/browser.cxx  |    2 +-
 fltk-1.3.0/test/demo.cxx     |    2 +-
 fltk-1.3.0/test/hello.cxx    |    2 +-
 fltk-1.3.0/test/help.cxx     |    2 +-
 fltk-1.3.0/test/input.cxx    |    2 --
 fltk-1.3.0/test/rtems_main.h |   11 -----------
 9 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/fltk-1.3.0/rtems_main.cxx b/fltk-1.3.0/rtems_main.cxx
new file mode 100644
index 0000000..8808686
--- /dev/null
+++ b/fltk-1.3.0/rtems_main.cxx
@@ -0,0 +1,25 @@
+//#ifndef RTEMS_MAIN_H
+//#define RTEMS_MAIN_H
+
+//transform call to main to call to rtems_main
+//#define main(x,y) rtems_main(x,y)
+//#define main(x)   rtems_main(x)
+//#define main()    rtems_main()
+
+//extern "C" int rtems_main(int argc, char **argv)
+//{
+//  main(argc, argv);
+//}
+//
+//
+//#endif
+//extern "C" 
+extern int main(int argc, char **argv);
+
+
+extern "C" int rtems_main(int argc, char **argv)
+{
+  using namespace std;
+  return main(argc, argv);
+}
+
diff --git a/fltk-1.3.0/test/Makefile b/fltk-1.3.0/test/Makefile
index a27459c..cb501bc 100644
--- a/fltk-1.3.0/test/Makefile
+++ b/fltk-1.3.0/test/Makefile
@@ -31,7 +31,7 @@ include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
 include $(RTEMS_CUSTOM)
 include $(PROJECT_ROOT)/make/leaf.cfg
 
-LDLIBS+= ../../microwin/src/obj/rtems_init.o ../../microwin/src/obj/FilesystemImage.o 
+LDLIBS+= ../../microwin/src/obj/rtems_init.o ../../microwin/src/obj/FilesystemImage.o ../rtems_main.cxx 
 
 CPPFILES =\
 	unittests.cxx \
diff --git a/fltk-1.3.0/test/blocks.cxx b/fltk-1.3.0/test/blocks.cxx
index af293d1..7e250c0 100644
--- a/fltk-1.3.0/test/blocks.cxx
+++ b/fltk-1.3.0/test/blocks.cxx
@@ -494,7 +494,7 @@ class BlockWindow : public Fl_Double_Window
 Fl_Preferences	BlockWindow::prefs_(Fl_Preferences::USER, "fltk.org", "blocks");
 
 
-extern "C" int rtems_main(int argc, char *argv[]) {
+int main(int argc, char *argv[]) {
   Fl::scheme("plastic");
   Fl::visible_focus(0);
 
diff --git a/fltk-1.3.0/test/browser.cxx b/fltk-1.3.0/test/browser.cxx
index 7142171..26a8444 100644
--- a/fltk-1.3.0/test/browser.cxx
+++ b/fltk-1.3.0/test/browser.cxx
@@ -122,7 +122,7 @@ void sort_cb(Fl_Widget *, void *) {
   browser->sort(FL_SORT_ASCENDING);
 }
 
-extern "C" int rtems_main(int argc, char **argv) {
+int main(int argc, char **argv) {
   int i;
   if (!Fl::args(argc,argv,i)) Fl::fatal(Fl::help);
   const char* fname = (i < argc) ? argv[i] : "browser.cxx";
diff --git a/fltk-1.3.0/test/demo.cxx b/fltk-1.3.0/test/demo.cxx
index 155cddd..49e544c 100644
--- a/fltk-1.3.0/test/demo.cxx
+++ b/fltk-1.3.0/test/demo.cxx
@@ -395,7 +395,7 @@ int load_the_menu(const char* fname)
   return 1;
 }
 
-extern "C" int rtems_main(int argc, char **argv) {
+int main(int argc, char **argv) {
   putenv((char *)"FLTK_DOCDIR=../documentation/html");
   char buf[FL_PATH_MAX];
   strcpy(buf, argv[0]);
diff --git a/fltk-1.3.0/test/hello.cxx b/fltk-1.3.0/test/hello.cxx
index dbb85bb..0e5f820 100644
--- a/fltk-1.3.0/test/hello.cxx
+++ b/fltk-1.3.0/test/hello.cxx
@@ -29,7 +29,7 @@
 #include <FL/Fl_Window.H>
 #include <FL/Fl_Box.H>
 
-extern "C" int rtems_main(int argc, char **argv) {
+int main(int argc, char **argv) {
   Fl_Window *window = new Fl_Window(340,180);
   Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!");
   box->box(FL_UP_BOX);
diff --git a/fltk-1.3.0/test/help.cxx b/fltk-1.3.0/test/help.cxx
index 0c58b90..7f7103a 100644
--- a/fltk-1.3.0/test/help.cxx
+++ b/fltk-1.3.0/test/help.cxx
@@ -60,7 +60,7 @@ void set_app_dir() {
 //
 
 				// O - Exit status
-extern "C" int rtems_main(int  argc,			// I - Number of command-line arguments
+int main(int  argc,			// I - Number of command-line arguments
      char *argv[])		// I - Command-line arguments
 {
   Fl_Help_Dialog	*help;		// Help dialog
diff --git a/fltk-1.3.0/test/input.cxx b/fltk-1.3.0/test/input.cxx
index ae8ea7c..762398d 100644
--- a/fltk-1.3.0/test/input.cxx
+++ b/fltk-1.3.0/test/input.cxx
@@ -25,8 +25,6 @@
 //     http://www.fltk.org/str.php
 //
 
-#include "rtems_main.h"
-
 #include <stdio.h>
 #include <FL/Fl.H>
 #include <FL/Fl_Window.H>
diff --git a/fltk-1.3.0/test/rtems_main.h b/fltk-1.3.0/test/rtems_main.h
deleted file mode 100644
index c664660..0000000
--- a/fltk-1.3.0/test/rtems_main.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef RTEMS_MAIN_H
-#define RTEMS_MAIN_H
-
-//transform call to main to call to rtems_main
-#define main(x,y) rtems_main(x,y)
-//#define main(x)   rtems_main(x)
-//#define main()    rtems_main()
-
-extern "C" int rtems_main(int argc, char **argv);
-
-#endif




More information about the vc mailing list