Hello Tommi,
That is really neat that tntdb will soon be version 1.0.0.
I have a little feature request, but since this is for a little addition
to the ABI, it could be left until later:
I was wondering if it might be useful to have a method in tntdb::Connection()
that would return an integer to say which database is currently being used,
something like:
0 - sqlite
1 - postgresql
2 - mysql
3 - oracle
With the idea that if an application needed to be able to support different
databases at runtime (which of course tntdb supports), and the application
needed to have slightly different SQL for different databases, then it
could use the integer as an index into arrays to look up the appropriate
SQL for the database that is being used at runtime.
Sun Studio 12 with -m64 (64 bit) on Solaris 10u4 x86 encounters some
compiler errors with tntdb 1.0.0, which look easy enough to fix.
However I am not sure if you want to use the :: namespace or ::std:: namespace
typedefs for size_t, int64_t, exit(), etc.
-*- mode: compilation; default-directory: "/h/goanna/2/ts/tntnet/tntdb-1.0.0/"
-*-
Compilation started at Mon Feb 18 11:50:50
gmake
Making all in src
gmake[1]: Entering directory `/h/goanna/2/ts/tntnet/tntdb-1.0.0/src'
gmake all-am
gmake[2]: Entering directory `/h/goanna/2/ts/tntnet/tntdb-1.0.0/src'
source='blob.cpp' object='libtntdb_la-blob.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../depcomp \
/bin/bash ../libtool --tag=CXX --mode=compile CC -DHAVE_CONFIG_H -I. -I. -I.
-I../include -I/h/goanna/2/ts/boost/boost_1_34_1
-I/h/goanna/1/s_5.10_m64/c/include -I/usr/xpg4/include -I/usr/sfw/include
-I/h/goanna/1/oracle/oracle/product/10.2.0/db_1/rdbms/public
-DDRIVERDIR=\"/h/goanna/1/s_5.10_m64/c/lib/tntdb\" -D_REENTRANT -mt -g
-xdebugformat=stabs -mt -library=stlport4 -xs -m64
-I/h/goanna/1/s_5.10_m64/c/include -c -o libtntdb_la-blob.lo `test -f
'blob.cpp' || echo './'`blob.cpp
mkdir .libs
CC -DHAVE_CONFIG_H -I. -I. -I. -I../include
-I/h/goanna/2/ts/boost/boost_1_34_1 -I/h/goanna/1/s_5.10_m64/c/include
-I/usr/xpg4/include -I/usr/sfw/include
-I/h/goanna/1/oracle/oracle/product/10.2.0/db_1/rdbms/public
-DDRIVERDIR=\"/h/goanna/1/s_5.10_m64/c/lib/tntdb\" -D_REENTRANT -mt -g
-xdebugformat=stabs -mt -library=stlport4 -xs -m64
-I/h/goanna/1/s_5.10_m64/c/include -c blob.cpp -KPIC -DPIC -o
.libs/libtntdb_la-blob.o
"../include/tntdb/iface/iblob.h", line 52: Error: size_t is not defined.
"../include/tntdb/iface/iblob.h", line 52: Error: A member cannot be
initialized except in a constructor.
"../include/tntdb/iface/iblob.h", line 56: Error: Use ";" to terminate
declarations.
"../include/tntdb/iface/iblob.h", line 56: Error: size_t is not defined.
"../include/tntdb/iface/iblob.h", line 56: Error: A member cannot be
initialized except in a constructor.
"../include/tntdb/iface/iblob.h", line 64: Error: Use ";" to terminate
declarations.
"../include/tntdb/iface/iblob.h", line 74: Error: Type name expected instead of
"size_t".
"../include/tntdb/iface/iblob.h", line 74: Error: Identifier expected instead
of "const".
"../include/tntdb/iface/iblob.h", line 74: Error: Use ";" to terminate
declarations.
"../include/tntdb/iface/iblob.h", line 79: Error: Use ";" to terminate
declarations.
"../include/tntdb/iface/iblob.h", line 97: Error: Type name expected instead of
"size_t".
"../include/tntdb/impl/blob.h", line 45: Error: size_t is not defined.
"../include/tntdb/impl/blob.h", line 47: Error: size_t is not defined.
"../include/tntdb/bits/blob.h", line 58: Error: size_t is not defined.
"../include/tntdb/bits/blob.h", line 72: Error: size_t is not defined.
"../include/tntdb/bits/blob.h", line 87: Error: size_t is not defined.
"../include/tntdb/bits/blob.h", line 111: Error: Type name expected instead of
"size_t".
"../include/tntdb/bits/blob.h", line 111: Error: Identifier expected instead of
"const".
"../include/tntdb/bits/blob.h", line 111: Error: Use ";" to terminate
declarations.
"../include/tntdb/bits/blob.h", line 61: Error: len is not defined.
"../include/tntdb/bits/blob.h", line 61: Error: assign is not a member of
tntdb::IBlob.
"blob.cpp", line 27: Error: size_t is not defined.
"blob.cpp", line 29: Error: len is not defined.
"blob.cpp", line 30: Error: len is not defined.
"blob.cpp", line 31: Error: len is not defined.
Compilation aborted, too many Error messages.
gmake[2]: *** [libtntdb_la-blob.lo] Error 1
gmake[2]: Leaving directory `/h/goanna/2/ts/tntnet/tntdb-1.0.0/src'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/h/goanna/2/ts/tntnet/tntdb-1.0.0/src'
gmake: *** [all-recursive] Error 1
Compilation exited abnormally with code 2 at Mon Feb 18 11:50:51
So I check it out of subversion, but it gives different compiler errors:
-*- mode: compilation; default-directory: "/h/goanna/2/ts/tntnet/tntdb/" -*-
Compilation started at Mon Feb 18 15:22:17
gmake
Making all in src
gmake[1]: Entering directory `/h/goanna/2/ts/tntnet/tntdb/src'
cd .. && /bin/bash /h/goanna/2/ts/tntnet/tntdb/missing --run autoheader
rm -f stamp-h1
touch config.h.in
cd .. && /bin/bash ./config.status src/config.h
config.status: creating src/config.h
config.status: src/config.h is unchanged
gmake all-am
gmake[2]: Entering directory `/h/goanna/2/ts/tntnet/tntdb/src'
source='blob.cpp' object='libtntdb_la-blob.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ../depcomp \
/bin/bash ../libtool --tag=CXX --mode=compile CC -DHAVE_CONFIG_H -I.
-I../include -I/h/goanna/2/ts/boost/boost_1_34_1
-I/h/goanna/1/s_5.10_m64/c/include -I/usr/xpg4/include -I/usr/sfw/include
-I/h/goanna/1/oracle/oracle/product/10.2.0/db_1/rdbms/public
-DDRIVERDIR=\"/h/goanna/1/s_5.10_m64/c/lib/tntdb\" -D_REENTRANT -mt -g
-xdebugformat=stabs -mt -library=stlport4 -xs -m64
-I/h/goanna/1/s_5.10_m64/c/include -c -o libtntdb_la-blob.lo `test -f
'blob.cpp' || echo './'`blob.cpp
mkdir .libs
CC -DHAVE_CONFIG_H -I. -I../include -I/h/goanna/2/ts/boost/boost_1_34_1
-I/h/goanna/1/s_5.10_m64/c/include -I/usr/xpg4/include -I/usr/sfw/include
-I/h/goanna/1/oracle/oracle/product/10.2.0/db_1/rdbms/public
-DDRIVERDIR=\"/h/goanna/1/s_5.10_m64/c/lib/tntdb\" -D_REENTRANT -mt -g
-xdebugformat=stabs -mt -library=stlport4 -xs -m64
-I/h/goanna/1/s_5.10_m64/c/include -c blob.cpp -KPIC -DPIC -o
.libs/libtntdb_la-blob.o
"/h/goanna/1/s_5.10_m64/c/include/cxxtools/atomicity.gcc.x86_64.h", line 38:
Warning: The variable tmp has not yet been assigned a value.
"/h/goanna/1/s_5.10_m64/c/include/cxxtools/atomicity.gcc.x86_64.h", line 87:
Warning: The variable ret has not yet been assigned a value.
"/h/goanna/1/s_5.10_m64/c/include/cxxtools/atomicity.gcc.x86_64.h", line 109:
Warning: The variable old has not yet been assigned a value.
"blob.cpp", line 51: Error: "tntdb::BlobImpl::reserve(unsigned long, bool)" is
expected to return a value.
1 Error(s) and 3 Warning(s) detected.
gmake[2]: *** [libtntdb_la-blob.lo] Error 1
gmake[2]: Leaving directory `/h/goanna/2/ts/tntnet/tntdb/src'
gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory `/h/goanna/2/ts/tntnet/tntdb/src'
gmake: *** [all-recursive] Error 1
Compilation exited abnormally with code 2 at Mon Feb 18 15:22:18
cxxtools in svn compiles fine. tntnet in svn requires the following diffs
to compile with Sun Studio 12 with -m64 (64 bit) on Solaris 10:
goanna% svn diff tntnet
Index: tntnet/framework/runtime/main.cpp
===================================================================
--- tntnet/framework/runtime/main.cpp (revision 986)
+++ tntnet/framework/runtime/main.cpp (working copy)
@@ -23,6 +23,7 @@
#include "tnt/tntconfig.h"
#include <cxxtools/log.h>
#include <cxxtools/loginit.h>
+#include <stdlib.h>
#include <sys/stat.h>
#include "tnt/process.h"
#include "config.h"
Index: tntnet/framework/common/worker.cpp
===================================================================
--- tntnet/framework/common/worker.cpp (revision 986)
+++ tntnet/framework/common/worker.cpp (working copy)
@@ -27,6 +27,7 @@
#include <tnt/http.h>
#include <tnt/poller.h>
#include <cxxtools/log.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
Index: tntnet/framework/common/tnt/ecpp.h
===================================================================
--- tntnet/framework/common/tnt/ecpp.h (revision 986)
+++ tntnet/framework/common/tnt/ecpp.h (working copy)
@@ -227,11 +227,11 @@
tnt::Scope& _scope = scope;
\
tnt::Scope::pointer_type _ptr = _scope.get(varname##_scopekey);
\
if (_ptr.getPointer())
\
- varname##_pointer = static_cast<tnt::PointerObject<type>*>(
\
+ varname##_pointer = static_cast<tnt::PointerObject<type >*>(
\
_ptr.getPointer())->get();
\
else
\
{
\
- tnt::PointerObject<type>* _poptr = new tnt::PointerObject<type>();
\
+ tnt::PointerObject<type >* _poptr = new tnt::PointerObject<type >();
\
_ptr = _poptr;
\
_poptr->set(varname##_pointer = new type construct);
\
_scope.put(varname##_scopekey, _ptr);
\
goanna%
Thanks, Mark
--
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general