Update SDB from git

This commit is contained in:
pancake 2022-11-23 09:34:55 +01:00 committed by pancake
parent aa536ce554
commit 590208e26a
7 changed files with 15 additions and 14 deletions

View File

@ -30,10 +30,10 @@ include wasi.mk
x xxx cxx:
# $(MAKE) CC="gcc -x c++ -Wall -fpermissive"
$(MAKE) CC=g++ CFLAGS="-fPIC -x c++ -Wall -fpermissive"
$(MAKE) CC=g++ CFLAGS="-fPIC -x c++ -Wall -fpermissive -I../include -Werror"
o xo xoxo ox:
g++ -o sdb src/*.c -I src/
g++ -o sdb src/*.c -I include/
wasi wasm: $(WASI_SDK)
${MAKE} include/sdb/version.h
@ -70,7 +70,7 @@ EMCCFLAGS=-O2 -s EXPORTED_FUNCTIONS="['_sdb_querys','_sdb_new0']"
#EMCCFLAGS+=--embed-file sdb.data
sdb.js: include/sdb/version.h
cd src ; emcc ${EMCCFLAGS} -I. -o ../sdb.js ${CFILES}
cd src ; emcc ${EMCCFLAGS} -I../include -o ../sdb.js ${CFILES}
clean:
rm -f include/sdb/version.h

View File

@ -45,7 +45,7 @@ CFLAGS+=-Wsign-compare
# some old gcc doesnt support this
# CFLAGS+=-Wmissing-field-initializers
#CFLAGS+=-O3
CFLAGS+=-g -Wall -O0
# CFLAGS+=-g -Wall -O0
#CFLAGS+=-g
#LDFLAGS+=-g -flto

View File

@ -70,7 +70,7 @@ libsdb_sources = [
'src/text.c'
]
sdb_inc = include_directories(['.', 'include'])
sdb_inc = include_directories(['include'])
rpath_lib = ''
rpath_exe = ''
if get_option('local') and get_option('default_library') == 'shared'

View File

@ -1,10 +1,11 @@
include ../config.mk
CFLAGS:=-g $(CFLAGS)
# CFLAGS:=-g $(CFLAGS)
OBJ=cdb.o buffer.o cdb_make.o ls.o ht.o ht_uu.o sdb.o num.o base64.o match.o
OBJ+=json.o ns.o lock.o util.o disk.o query.o array.o fmt.o journal.o text.o
OBJ+=dict.o ht_pp.o ht_up.o ht_pu.o set.o diff.o
CFLAGS+=-I ../include
SDB_CFLAGS+=-I../include
SDB_CXXFLAGS+=-I../include
SOBJ=$(subst .o,.o.o,${OBJ})
WITHPIC?=1
BIN=sdb${EXT_EXE}
@ -77,7 +78,7 @@ mrproper clean:
ifneq ($(SILENT),)
@echo LD $<
endif
$(CC) $(LDFLAGS) -c $(CFLAGS) -o $@ $<
$(CC) $(LDFLAGS) -c $(CFLAGS) $(SDB_CFLAGS) -o $@ $<
S=$
@ -85,14 +86,14 @@ S=$
ifneq ($(SILENT),)
@echo CC $<
endif
$(CC) -c ${CPPFLAGS} ${CFLAGS} ${CFLAGS_SHARED} -o $@ $<
$(CC) -c ${CPPFLAGS} ${CFLAGS} $(SDB_CFLAGS) ${CFLAGS_SHARED} -o $@ $<
%.o.o: %.c
ifneq ($(SILENT),)
@echo CC PIC $<
endif
@mv `echo $<|sed -e 's,\.c$S,\.d,g'` $<.tmp 2>/dev/null || true
$(CC) -c ${CPPFLAGS} ${CFLAGS} ${CFLAGS_SHARED} -o $@ $<
$(CC) -c ${CPPFLAGS} ${CFLAGS} $(SDB_CFLAGS) ${CFLAGS_SHARED} -o $@ $<
@mv `echo $<|sed -e 's,\.c$S,\.d,g'` `echo $<|sed -e 's,\.c$S,\._d,g'` 2>/dev/null || true
@mv $<.tmp `echo $<|sed -e 's,\.c$S,\.d,g'` 2>/dev/null ||true

View File

@ -24,8 +24,8 @@ static const char *Aindexof(const char *str, int idx) {
}
static int astrcmp(const char *a, const char *b) {
register char va = *a;
register char vb = *b;
char va = *a;
char vb = *b;
for (;;) {
if (va == '\0' || va == SDB_RS) {
if (vb == '\0' || vb == SDB_RS) {

View File

@ -4,7 +4,7 @@ HASOVR=$(shell clang -Wno-initializer-overrides -E -</dev/null 2>&1| grep unknow
ifeq ($(HASOVR),)
CFLAGS+=-Wno-initializer-overrides
endif
CFLAGS+=-Wall -g
# CFLAGS+=-Wall -g
BIN=a.out
OBJ=rangstr.o path.o js0n.o api.o main.o
OBJ+=../libsdb.a

View File

@ -775,7 +775,7 @@ typedef struct {
static bool sdb_foreach_match_cb(void *user, const char *k, const char *v) {
_match_sdb_user *o = (_match_sdb_user*)user;
SdbKv tkv = {0};
SdbKv tkv = {{0}};
tkv.base.key = (char *)k;
tkv.base.value = (char *)v;
if (sdbkv_match (&tkv, o->expr)) {