Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c)) src/ktlangc.o
PG_CONFIG = /usr/local/pgsql/bin/pg_config
SHLIB_LINK = -lkyototycoon -lsasl2

CXXFLAGS = -march=native -m64 -g -O2 -Wall -fPIC -fsigned-char -g0 -O2 -Wno-unused-but-set-variable -Wno-unused-but-set-parameter
ARCH := $(shell getconf LONG_BIT)
CPP_FLAGS_32 := -m32
CPP_FLAGS_64 := -m64

CXXFLAGS = -march=native $(CPP_FLAGS_$(ARCH)) -g -O2 -Wall -fPIC -fsigned-char -g0 -O2 -Wno-unused-but-set-variable -Wno-unused-but-set-parameter
PG_CPPFLAGS = -DUSE_TRANSACTIONS

all: sql/$(EXTENSION)--$(EXTVERSION).sql
Expand Down
4 changes: 2 additions & 2 deletions src/ktlangc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ bool ktadd(KTDB*db, const char * key, const char * value)
std::string skey(key);
std::string sval(value);

return pdb->add(skey, sval);
return pdb->add(skey, sval, MAX_EXPIRY);
}

bool ktreplace(KTDB*db, const char * key, const char * value)
Expand All @@ -134,7 +134,7 @@ bool ktreplace(KTDB*db, const char * key, const char * value)
std::string skey(key);
std::string sval(value);

return pdb->replace(skey, sval);
return pdb->replace(skey, sval, MAX_EXPIRY);
}


Expand Down
8 changes: 8 additions & 0 deletions src/ktlangc.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ extern "C" {
#include <time.h>
#include <stdint.h>

#if !defined(MAX_EXPIRY)
#if defined(INT64MAX)
#define MAX_EXPIRY INT64MAX
#else
#define MAX_EXPIRY INT_MAX
#endif
#endif

/**
* C wrapper of polymorphic database.
*/
Expand Down