Commit f87b4e5d authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

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

git-svn-id: file:///svn/tokudb@1196 c7de825b-a66e-492c-adef-691d508d4ae1
parent ad106f27
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
......@@ -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;
}
......
......@@ -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:
......
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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment