Make db_create work a little more under c++. Addresses #197.

git-svn-id: file:///svn/tokudb@1196 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Bradley C. Kuszmaul 2007-12-18 16:34:48 +00:00
parent ad106f2713
commit f87b4e5d7d
4 changed files with 14 additions and 3 deletions

View file

@ -1,5 +1,10 @@
CPPFLAGS = -I../include
CXXFLAGS = -Wall -g
CC = c++
LDFLAGS = -lz
SRCS = $(wildcard *.cpp)
OBJS = $(patsubst %.cpp, %.o, $(SRCS))
default: $(OBJS)
$(OBJS): db_cxx.h
test1: test1.o dbt.o db.o dbenv.o ../lib/libdb.a

View file

@ -3,9 +3,11 @@
#include <errno.h>
#include "db_cxx.h"
Db::Db(DbEnv *env, u_int32_t flags) {
Db::Db(DbEnv *env, u_int32_t flags)
: the_Env(env)
{
the_db = 0;
the_Env = env;
if (the_Env == 0) {
is_private_env = 1;
}

View file

@ -69,6 +69,7 @@ class DbEnv {
DbEnv(u_int32_t flags);
DB_ENV *get_DB_ENV(void) {
if (this==0) return 0;
return the_env;
}
@ -86,6 +87,7 @@ class DbTxn {
public:
DB_TXN *get_DB_TXN()
{
if (this==0) return 0;
return the_txn;
}
private:

View file

@ -1,13 +1,15 @@
SRCS = $(wildcard *.cpp)
TARGETS = $(patsubst %.cpp,%,$(SRCS))
DBCXX = ../dbt.o ../db.o ../dbenv.o ../dbt.o
DBCXX = ../dbt.o ../db.o ../dbenv.o
CPPFLAGS = -I../ -I../../include
CXXFLAGS = -Wall -g
LDFLAGS = -L../lib -ldb
$(TARGETS): $(DBCXX)
$(DBCXX):
cd ..;make
all: $(TARGETS)
clean: