This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

STLport with exception handling


I got STLport to work w/exception handling together with eCos.

Rejoice! :-)


Is there anyone out there who uses STL, C++ exception handling and eCos?



I'm still taking it for a spin, but it compiles and appears to
work correctly.

The configuration procedure is still a black artc to me. I've attached
the changes I did to STLport-5.0-0125.


I never saw any response to my C++ exception handling multithreading
support. Is there a more approperiate solution out there?

http://sources.redhat.com/ml/ecos-discuss/2003-07/msg00233.html

>From my .mak file:

XCXX          = $(ECOS_COMMAND_PREFIX)c++
CXXFLAGS      = -I../STLport-5.0-0125/stlport $(CFLAGS) -O0
-fno-vtable-gc -fexceptions
-I../ecos-install/ecos/gnutools/arm-elf/arm-elf/include/arm-elf



Øyvind

diff -aur ../STLport-4.6/stlport/cstdio stlport/cstdio
--- ../STLport-4.6/stlport/cstdio	2003-07-21 03:36:41.000000000 +0200
+++ stlport/cstdio	2004-01-21 10:41:45.275408000 +0100
@@ -98,16 +98,20 @@
 using _STLP_VENDOR_CSTD::perror;
 using _STLP_VENDOR_CSTD::printf;
 using _STLP_VENDOR_CSTD::puts;
+#  if (!defined (__ECOS__))
 using _STLP_VENDOR_CSTD::remove;
 using _STLP_VENDOR_CSTD::rename;
+#  endif
 using _STLP_VENDOR_CSTD::rewind;
 using _STLP_VENDOR_CSTD::scanf;
 using _STLP_VENDOR_CSTD::setbuf;
 using _STLP_VENDOR_CSTD::setvbuf;
 using _STLP_VENDOR_CSTD::sprintf;
 using _STLP_VENDOR_CSTD::sscanf;
+#  if (!defined (__ECOS__))
 using _STLP_VENDOR_CSTD::tmpfile;
 using _STLP_VENDOR_CSTD::tmpnam;
+#endif
 using _STLP_VENDOR_CSTD::ungetc;
 using _STLP_VENDOR_CSTD::vfprintf;
 using _STLP_VENDOR_CSTD::vprintf;
diff -aur ../STLport-4.6/stlport/new.h stlport/new.h
--- ../STLport-4.6/stlport/new.h	2003-10-09 05:30:02.000000000 +0200
+++ stlport/new.h	2004-01-21 10:51:47.691640000 +0100
@@ -21,6 +21,17 @@
 #  define _STLP_DONT_POP_0x848
 # endif
 
+
+
+#ifdef __ECOS__
+// Default placement versions of operator new.
+inline void* operator new(size_t, void* __p) throw() { return __p; }
+inline void* operator new[](size_t, void* __p) throw() { return __p; }
+
+// Default placement versions of operator delete.
+inline void  operator delete  (void*, void*) throw() { };
+inline void  operator delete[](void*, void*) throw() { };
+#else
 # ifndef _STLP_WINCE
 # if defined (__BORLANDC__)
 #  include <new.>
@@ -33,7 +44,9 @@
 #   include _STLP_NATIVE_CPP_RUNTIME_HEADER(new.h)
 #  endif
 # endif
-# endif /* STL_WINCE */
+# endif 
+#endif // __ECOS__
+
 
 # if (_STLP_OUTERMOST_HEADER_ID == 0x848)
 #  if ! defined (_STLP_DONT_POP_0x848)
diff -aur ../STLport-4.6/stlport/stl/_alloc.h stlport/stl/_alloc.h
--- ../STLport-4.6/stlport/stl/_alloc.h	2003-10-21 05:45:48.000000000 +0200
+++ stlport/stl/_alloc.h	2004-01-21 10:45:03.079836800 +0100
@@ -119,7 +119,7 @@
   }
 };
 
-
+#ifndef __ECOS__
 // New-based allocator.  Typically slower than default alloc below.
 // Typically thread-safe and more storage efficient.
 class _STLP_CLASS_DECLSPEC __new_alloc {
@@ -134,7 +134,7 @@
   static void* _STLP_CALL  allocate(size_t __n) {  return __stl_new(__n); }
   static void _STLP_CALL deallocate(void* __p, size_t) { __stl_delete(__p); }
 };
-
+#endif
 
 // Allocator adaptor to check size arguments for debugging.
 // Reports errors using assert.  Checking can be disabled with
diff -aur ../STLport-4.6/stlport/stl/_config.h stlport/stl/_config.h
--- ../STLport-4.6/stlport/stl/_config.h	2003-11-01 00:53:47.000000000 +0100
+++ stlport/stl/_config.h	2004-01-21 10:45:59.751326400 +0100
@@ -471,7 +471,7 @@
 /* if using stlport:: namespace or if C library stuff is not in vendor's std::,
  * try importing 'em.
  * MSVC has ambiguity problem when we try to import C-style std:: stuff back into global namespace */
-#  if defined (_STLP_USE_NAMESPACES) && /* ! defined (_STLP_OWN_IOSTREAMS) && */ \
+#  if defined (_STLP_USE_NAMESPACES) && /* ! defined (_STLP_OWN_IOSTREAMS) && */ !defined (__ECOS__) &&\
    ( defined(_STLP_USE_OWN_NAMESPACE) || defined (_STLP_VENDOR_GLOBAL_CSTD))
 #    define  _STLP_IMPORT_VENDOR_CSTD 1
 #  endif
diff -aur ../STLport-4.6/stlport/stl/_threads.h stlport/stl/_threads.h
--- ../STLport-4.6/stlport/stl/_threads.h	2003-10-22 19:58:59.000000000 +0200
+++ stlport/stl/_threads.h	2004-01-21 10:46:39.117932800 +0100
@@ -52,7 +52,7 @@
 # else 
 # if defined (_STLP_USE_NAMESPACES) && ! defined (_STLP_VENDOR_GLOBAL_CSTD)
 // using _STLP_VENDOR_CSTD::size_t;
-using namespace _STLP_VENDOR_CSTD;
+//using namespace _STLP_VENDOR_CSTD;
 # endif
   typedef size_t __stl_atomic_t;
 #endif  
diff -aur ../STLport-4.6/stlport/stl_user_config.h stlport/stl_user_config.h
--- ../STLport-4.6/stlport/stl_user_config.h	2003-07-23 21:51:51.000000000 +0200
+++ stlport/stl_user_config.h	2004-01-21 12:43:02.940176000 +0100
@@ -62,7 +62,7 @@
  * Use this switch for embedded systems where no iostreams are available
  * at all. STLport own iostreams will also get disabled automatically then.
  */
-// # define _STLP_NO_IOSTREAMS 1
+# define _STLP_NO_IOSTREAMS 1
 
 /* 
  * Set _STLP_DEBUG to turn the "Debug Mode" on.
@@ -197,6 +197,19 @@
 
 //==========================================================
 
+#define __ECOS__
+#define __CYGWIN__
+#define _STLP_NO_NEW_C_HEADERS
+#define _STLP_NO_NEW_NEW_HEADER
+#define _STLP_NO_OWN_NAMESPACE
+#define _STLP_USE_MALLOC
+#define _STLP_NODE_ALLOC_USE_MALLOC
+#define _STLP_NO_WCHAR_T
+//#define _STLP_DEBUG_ALLOC
+//#define __INTEL_COMPILER 0
+//#define __APPLE__ 0
+
+
 // Local Variables:
 // mode:C++
 // End:

-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]