Hi Tommi,

The comp_ptr testcase runs fine compiled 32 bit with gcc on Linux.
I don't know why it crashes compiled 64 bit with Sun Studio 12 on
Solaris 10.

I had to do a few tweaks to compile it with Sun Studio 12 on Solaris.
I also compiled it with these diffs using gcc on Linux.

Thanks very much, Mark

Index: cxxtools/include/cxxtools/log/cxxtools.h
===================================================================
--- cxxtools/include/cxxtools/log/cxxtools.h    (revision 831)
+++ cxxtools/include/cxxtools/log/cxxtools.h    (working copy)
@@ -32,6 +32,7 @@
 #include <string>
 #include <cxxtools/mutex.h>
 #include <iostream>
+#include <sstream>
 
 #define log_xxxx_enabled(level)   \
   (getLogger() != 0 && getLogger()->isEnabled(::cxxtools::Logger::LOG_LEVEL_ 
## level))
Index: cxxtools/include/cxxtools/string.h
===================================================================
--- cxxtools/include/cxxtools/string.h  (revision 831)
+++ cxxtools/include/cxxtools/string.h  (working copy)
@@ -89,6 +89,8 @@
 
         basic_string(cxxtools::Char* begin, cxxtools::Char* end);
 
+        basic_string(const cxxtools::Char* begin, const cxxtools::Char* end);
+
         ~basic_string();
 
     public:
Index: cxxtools/include/cxxtools/string.tpp
===================================================================
--- cxxtools/include/cxxtools/string.tpp        (revision 831)
+++ cxxtools/include/cxxtools/string.tpp        (working copy)
@@ -109,6 +109,10 @@
 {
 }
 
+inline basic_string<cxxtools::Char>::basic_string(const cxxtools::Char* begin, 
const cxxtools::Char* end)
+: _data( new cxxtools::StringData( begin, end - begin ) )
+{
+}
 
 inline basic_string<cxxtools::Char>::~basic_string()
 {
Index: cxxtools/include/cxxtools/char.h
===================================================================
--- cxxtools/include/cxxtools/char.h    (revision 831)
+++ cxxtools/include/cxxtools/char.h    (working copy)
@@ -32,6 +32,7 @@
 #include <cxxtools/types.h>
 #include <string>
 #include <cstring>
+#include <ios>
 
 namespace cxxtools {
 
@@ -319,8 +320,8 @@
     {
         typedef cxxtools::Char char_type;
         typedef cxxtools::uint32_t int_type;
-        typedef streamoff off_type;
-        typedef streampos pos_type;
+        typedef std::streamoff off_type;
+        typedef std::streampos pos_type;
         typedef cxxtools::MBState state_type;
 
         inline static void assign(char_type& c1, const char_type& c2);
Index: cxxtools/configure.in
===================================================================
--- cxxtools/configure.in       (revision 831)
+++ cxxtools/configure.in       (working copy)
@@ -21,8 +21,11 @@
 AC_PROG_CC
 AC_PROG_CXX
 
+AC_CHECK_HEADERS(sys/filio.h)
+
 AC_CHECK_LIB(nsl, setsockopt)
 AC_CHECK_LIB(socket, accept)
+AC_CHECK_LIB(rt, sem_destroy)
 AC_SEARCH_LIBS(dlopen, dl, , AC_MSG_ERROR([dlopen not found]))
 AC_SEARCH_LIBS(inet_ntop, nsl socket resolv)
 AC_CHECK_FUNCS(inet_ntop)
Index: cxxtools/src/tcpserverimpl.cpp
===================================================================
--- cxxtools/src/tcpserverimpl.cpp      (revision 831)
+++ cxxtools/src/tcpserverimpl.cpp      (working copy)
@@ -38,6 +38,7 @@
 #include <cstring>
 #include <unistd.h>
 #include <fcntl.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/poll.h>
Index: cxxtools/src/tcpsocketimpl.cpp
===================================================================
--- cxxtools/src/tcpsocketimpl.cpp      (revision 831)
+++ cxxtools/src/tcpsocketimpl.cpp      (working copy)
@@ -39,6 +39,7 @@
 #include <cstring>
 #include <cassert>
 #include <fcntl.h>
+#include <string.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
Index: cxxtools/src/directoryimpl.cpp
===================================================================
--- cxxtools/src/directoryimpl.cpp      (revision 831)
+++ cxxtools/src/directoryimpl.cpp      (working copy)
@@ -34,6 +34,7 @@
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <limits.h>
 
 namespace cxxtools {
 
Index: cxxtools/src/atomicity.sun.cpp
===================================================================
--- cxxtools/src/atomicity.sun.cpp      (revision 831)
+++ cxxtools/src/atomicity.sun.cpp      (working copy)
@@ -37,6 +37,20 @@
 typedef long atomic_t;
 
 
+atomic_t atomicGet(volatile atomic_t& val)
+{
+    asm volatile ("mfence" : : : "memory");
+    return val;
+}
+
+
+void atomicSet(volatile atomic_t& val, atomic_t n)
+{
+    val = n;
+    asm volatile ("mfence" : : : "memory");
+}
+
+  
 atomic_t atomicIncrement(volatile atomic_t& value)
 {
     volatile ulong_t* uvalue = reinterpret_cast<volatile ulong_t*>(&value);
Index: cxxtools/src/http/messageheader.cpp
===================================================================
--- cxxtools/src/http/messageheader.cpp (revision 831)
+++ cxxtools/src/http/messageheader.cpp (working copy)
@@ -30,6 +30,7 @@
 #include <cxxtools/clock.h>
 #include <cctype>
 #include <sstream>
+#include <stdio.h>
 
 namespace cxxtools {
 
Index: cxxtools/src/processimpl.cpp
===================================================================
--- cxxtools/src/processimpl.cpp        (revision 831)
+++ cxxtools/src/processimpl.cpp        (working copy)
@@ -26,11 +26,12 @@
 #include "processimpl.h"
 #include "iodeviceimpl.h"
 
-#include <cstdlib>
+#include <stdlib.h>
 #include <vector>
 #include <signal.h>
 #include <errno.h>
 #include <cstring> // strerror()
+#include <cstdio>
 #include <sys/wait.h>
 #include <sys/time.h>
 #include <sys/resource.h>
@@ -65,7 +66,7 @@
     {
         if( _procInfo.stdInputClosed() )
         {
-            fclose(stdin);
+            std::fclose(stdin);
         }
         else if(_procInfo.stdInput() )
         {
@@ -74,7 +75,7 @@
 
         if( _procInfo.stdOutputClosed() )
         {
-            fclose( stdout);
+            std::fclose(stdout);
         }
         else if( _procInfo.stdOutput() )
         {
@@ -83,7 +84,7 @@
 
         if( _procInfo.stdErrorClosed() )
         {
-            fclose(stderr);
+            std::fclose(stderr);
         }
         else if( _procInfo.stdError() )
         {
Index: cxxtools/src/hdstream.cpp
===================================================================
--- cxxtools/src/hdstream.cpp   (revision 831)
+++ cxxtools/src/hdstream.cpp   (working copy)
@@ -27,6 +27,7 @@
  */
 
 #include "cxxtools/hdstream.h"
+#include <ios>
 #include <iomanip>
 #include <cctype>
 
Index: cxxtools/src/mime.cpp
===================================================================
--- cxxtools/src/mime.cpp       (revision 831)
+++ cxxtools/src/mime.cpp       (working copy)
@@ -32,6 +32,7 @@
 #include <cxxtools/log.h>
 #include <stdlib.h>
 #include <vector>
+#include <ios>
 #include <sstream>
 #include <fstream>
 #include <stdexcept>
Index: cxxtools/src/fileimpl.cpp
===================================================================
--- cxxtools/src/fileimpl.cpp   (revision 831)
+++ cxxtools/src/fileimpl.cpp   (working copy)
@@ -33,6 +33,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
+#include <stdio.h>
 
 namespace cxxtools {
 
Index: cxxtools/src/tcpstream.cpp
===================================================================
--- cxxtools/src/tcpstream.cpp  (revision 831)
+++ cxxtools/src/tcpstream.cpp  (working copy)
@@ -27,7 +27,11 @@
  */
 
 #include <cxxtools/net/tcpstream.h>
+#include <unistd.h>
 #include <sys/ioctl.h>
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h>
+#endif
 
 namespace cxxtools
 {

Index: tntnet/sdk/tools/ecppc/tnt/ecppc/variable.h
===================================================================
--- tntnet/sdk/tools/ecppc/tnt/ecppc/variable.h (revision 1119)
+++ tntnet/sdk/tools/ecppc/tnt/ecppc/variable.h (working copy)
@@ -31,6 +31,7 @@
 #define TNT_ECPPC_VARIABLE_H
 
 #include <string>
+#include <ostream>
 
 namespace tnt
 {
Index: tntnet/framework/runtime/Makefile.am
===================================================================
--- tntnet/framework/runtime/Makefile.am        (revision 1119)
+++ tntnet/framework/runtime/Makefile.am        (working copy)
@@ -7,6 +7,5 @@
 
 tntnet_LDFLAGS = $(PTHREAD_LIBS)
 tntnet_LDADD = $(top_builddir)/framework/common/libtntnet.la
-tntnet_CXXFLAGS=-DTNTNET_CONF=\"@sysconfdir@/tntnet/tntnet.conf\" 
-DTNTNET_PID=\"@localstatedir@/tntnet.pid\"
-AM_CXXFLAGS=$(PTHREAD_CFLAGS)
+tntnet_CXXFLAGS=-DTNTNET_CONF=\"@sysconfdir@/tntnet/tntnet.conf\" 
-DTNTNET_PID=\"@localstatedir@/tntnet.pid\" $(PTHREAD_CFLAGS)
 
Index: tntnet/framework/common/tnt/messageheader.h
===================================================================
--- tntnet/framework/common/tnt/messageheader.h (revision 1119)
+++ tntnet/framework/common/tnt/messageheader.h (working copy)
@@ -30,6 +30,7 @@
 #ifndef TNT_MESSAGEHEADER_H
 #define TNT_MESSAGEHEADER_H
 
+#include <istream>
 #include <string>
 #include <map>
 #include <tnt/stringlessignorecase.h>
Index: tntnet/framework/common/tnt/scopemanager.h
===================================================================
--- tntnet/framework/common/tnt/scopemanager.h  (revision 1119)
+++ tntnet/framework/common/tnt/scopemanager.h  (working copy)
@@ -30,6 +30,7 @@
 #ifndef TNT_SCOPEMANAGER_H
 #define TNT_SCOPEMANAGER_H
 
+#include <string>
 #include <map>
 #include <string>
 #include <cxxtools/mutex.h>
Index: tntnet/framework/common/tnt/multipart.h
===================================================================
--- tntnet/framework/common/tnt/multipart.h     (revision 1119)
+++ tntnet/framework/common/tnt/multipart.h     (working copy)
@@ -33,6 +33,7 @@
 #include <tnt/messageheader.h>
 #include <tnt/contentdisposition.h>
 #include <vector>
+#include <iterator>
 
 namespace tnt
 {
@@ -70,8 +71,13 @@
 
     public:
       Part()
+#if defined(_RWSTDDEBUG) && !defined(_RWSTD_NO_DEBUG_ITER)
+        : bodyBegin(), bodyEnd()
+        { bodyBegin._C_iter = bodyEnd._C_iter = 0;}
+#else
         : bodyBegin(0), bodyEnd(0)
         { }
+#endif
 
       Part(const_iterator b, const_iterator e);
 
Index: tntnet/framework/common/httprequest.cpp
===================================================================
--- tntnet/framework/common/httprequest.cpp     (revision 1119)
+++ tntnet/framework/common/httprequest.cpp     (working copy)
@@ -389,7 +389,7 @@
     {
       public:
         bool operator() (char c1, char c2) const
-          { return tolower(c1) == tolower(c2); }
+        { return std::tolower(c1) == std::tolower(c2); }
     };
   }
 
Index: tntnet/framework/common/poller.cpp
===================================================================
--- tntnet/framework/common/poller.cpp  (revision 1119)
+++ tntnet/framework/common/poller.cpp  (working copy)
@@ -32,6 +32,7 @@
 #include "tnt/tntnet.h"
 #include <cxxtools/syserror.h>
 #include <cxxtools/log.h>
+#include <ios>
 #include <unistd.h>
 #include <fcntl.h>
 #ifdef WITH_EPOLL
Index: tntnet/framework/common/httpreply.cpp
===================================================================
--- tntnet/framework/common/httpreply.cpp       (revision 1119)
+++ tntnet/framework/common/httpreply.cpp       (working copy)
@@ -212,6 +212,7 @@
   void HttpReply::setContentLengthHeader(size_t size)
   {
     std::ostringstream s;
+    s.imbue(std::locale::classic());
     s << size;
     setHeader(httpheader::contentLength, s.str());
   }
@@ -224,6 +225,7 @@
     if (keepAliveTimeout > 0 && getKeepAliveCounter() > 0)
     {
       std::ostringstream s;
+      s.imbue(std::locale::classic());
       s << "timeout=" << keepAliveTimeout << ", max=" << getKeepAliveCounter();
       setHeader(httpheader::keepAlive, s.str());
 


Index: tntdb/src/time.cpp
===================================================================
--- tntdb/src/time.cpp  (revision 155)
+++ tntdb/src/time.cpp  (working copy)
@@ -84,8 +84,8 @@
 
   inline unsigned short getNumber2(const char* s)
   {
-    if (!isdigit(s[0])
-      || !isdigit(s[1]))
+    if (!std::isdigit(s[0])
+      || !std::isdigit(s[1]))
       throw TypeError();
     return (s[0] - '0') * 10
          + (s[1] - '0');
@@ -93,9 +93,9 @@
 
   inline unsigned short getNumber3(const char* s)
   {
-    if (!isdigit(s[0])
-      || !isdigit(s[1])
-      || !isdigit(s[2]))
+    if (!std::isdigit(s[0])
+      || !std::isdigit(s[1])
+      || !std::isdigit(s[2]))
       throw TypeError();
     return (s[0] - '0') * 100
          + (s[1] - '0') * 10
Index: tntdb/src/decimal.cpp
===================================================================
--- tntdb/src/decimal.cpp       (revision 155)
+++ tntdb/src/decimal.cpp       (working copy)
@@ -29,6 +29,7 @@
 #include <tntdb/decimal.h>
 #include <sstream>
 #include <iomanip>
+#include <ios>
 
 namespace tntdb
 {
Index: tntdb/src/date.cpp
===================================================================
--- tntdb/src/date.cpp  (revision 155)
+++ tntdb/src/date.cpp  (working copy)
@@ -97,8 +97,8 @@
 
   inline unsigned short getNumber2(const char* s)
   {
-    if (!isdigit(s[0])
-      || !isdigit(s[1]))
+    if (!std::isdigit(s[0])
+      || !std::isdigit(s[1]))
       throw TypeError();
     return (s[0] - '0') * 10
          + (s[1] - '0');
@@ -106,10 +106,10 @@
 
   inline unsigned short getNumber4(const char* s)
   {
-    if (!isdigit(s[0])
-      || !isdigit(s[1])
-      || !isdigit(s[2])
-      || !isdigit(s[3]))
+    if (!std::isdigit(s[0])
+      || !std::isdigit(s[1])
+      || !std::isdigit(s[2])
+      || !std::isdigit(s[3]))
       throw TypeError();
     return (s[0] - '0') * 1000
          + (s[1] - '0') * 100
Index: tntdb/src/mysql/connection.cpp
===================================================================
--- tntdb/src/mysql/connection.cpp      (revision 155)
+++ tntdb/src/mysql/connection.cpp      (working copy)
@@ -26,6 +26,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
  */
 
+#include <locale>
 #include <tntdb/mysql/impl/connection.h>
 #include <tntdb/mysql/impl/result.h>
 #include <tntdb/mysql/impl/statement.h>
@@ -156,7 +157,7 @@
           case state_port:
             if (*p == ';')
               state = state_key;
-            else if (std::isdigit(*p))
+            else if (std::isdigit(*p, std::locale::classic()))
               port = port * 10 + (*p - '0');
             else
               throw std::runtime_error(
@@ -166,7 +167,7 @@
           case state_flag:
             if (*p == ';')
               state = state_key;
-            else if (std::isdigit(*p))
+            else if (std::isdigit(*p, std::locale::classic()))
               client_flag = client_flag * 10 + (*p - '0');
             else
               throw std::runtime_error(
Index: tntdb/src/oracle/Makefile.am
===================================================================
--- tntdb/src/oracle/Makefile.am        (revision 155)
+++ tntdb/src/oracle/Makefile.am        (working copy)
@@ -20,7 +20,7 @@
 driver_LTLIBRARIES = tntdb2-oracle.la
 
 tntdb2_oracle_la_SOURCES = $(sources)
-tntdb2_oracle_la_LDFLAGS = -module -version-info @sonumber@ $(PTHREAD_LIBS) 
-lclntsh @SHARED_LIB_FLAG@
-tntdb2_oracle_la_LIBADD = $(top_srcdir)/src/libtntdb.la
+tntdb2_oracle_la_LDFLAGS = -module -version-info @sonumber@ $(PTHREAD_LIBS) 
@SHARED_LIB_FLAG@
+tntdb2_oracle_la_LIBADD = $(top_srcdir)/src/libtntdb.la -lclntsh
 
 endif
Index: tntdb/src/oracle/value.cpp
===================================================================
--- tntdb/src/oracle/value.cpp  (revision 155)
+++ tntdb/src/oracle/value.cpp  (working copy)
@@ -499,7 +499,7 @@
       log_debug("Value::getString with type=" << type << " name=" << colName
         << " size=" << len);
 
-      if (isNull())
+      if ((!((type == SQLT_AFC) || (type == SQLT_CHR))) && isNull())
         throw NullValue();
 
       switch (type)
Index: tntdb/src/datetime.cpp
===================================================================
--- tntdb/src/datetime.cpp      (revision 155)
+++ tntdb/src/datetime.cpp      (working copy)
@@ -101,8 +101,8 @@
 
   inline unsigned short getNumber2(const char* s)
   {
-    if (!isdigit(s[0])
-      || !isdigit(s[1]))
+    if (!std::isdigit(s[0])
+      || !std::isdigit(s[1]))
       throw TypeError();
     return (s[0] - '0') * 10
          + (s[1] - '0');
@@ -110,9 +110,9 @@
 
   inline unsigned short getNumber3(const char* s)
   {
-    if (!isdigit(s[0])
-      || !isdigit(s[1])
-      || !isdigit(s[2]))
+    if (!std::isdigit(s[0])
+      || !std::isdigit(s[1])
+      || !std::isdigit(s[2]))
       throw TypeError();
     return (s[0] - '0') * 100
          + (s[1] - '0') * 10
@@ -121,10 +121,10 @@
 
   inline unsigned short getNumber4(const char* s)
   {
-    if (!isdigit(s[0])
-      || !isdigit(s[1])
-      || !isdigit(s[2])
-      || !isdigit(s[3]))
+    if (!std::isdigit(s[0])
+      || !std::isdigit(s[1])
+      || !std::isdigit(s[2])
+      || !std::isdigit(s[3]))
       throw TypeError();
     return (s[0] - '0') * 1000
          + (s[1] - '0') * 100

-- 

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to