Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Enno Rehling 2018-01-28 18:42:22 +01:00
commit 1181cae463
4 changed files with 20 additions and 13 deletions

View File

@ -282,19 +282,19 @@ target_link_libraries(eressea bsd)
target_link_libraries(convert bsd)
endif (HAVE_LIBBSD)
if (DB_FOUND)
include_directories (${DB_INCLUDE_DIR})
target_link_libraries(convert ${DB_LIBRARIES})
target_link_libraries(eressea ${DB_LIBRARIES})
target_link_libraries(test_eressea ${DB_LIBRARIES})
add_definitions(-DUSE_DB)
elseif (SQLITE3_FOUND)
if (SQLITE3_FOUND)
include_directories (${SQLITE3_INCLUDE_DIR})
target_link_libraries(eressea ${SQLITE3_LIBRARIES})
target_link_libraries(convert ${SQLITE3_LIBRARIES})
target_link_libraries(test_eressea ${SQLITE3_LIBRARIES})
add_definitions(-DUSE_SQLITE)
endif(DB_FOUND)
elseif (DB_FOUND)
include_directories (${DB_INCLUDE_DIR})
target_link_libraries(convert ${DB_LIBRARIES})
target_link_libraries(eressea ${DB_LIBRARIES})
target_link_libraries(test_eressea ${DB_LIBRARIES})
add_definitions(-DUSE_DB)
endif(SQLITE3_FOUND)
if (CURSES_FOUND)
include_directories (${CURSES_INCLUDE_DIR})

View File

@ -480,6 +480,12 @@ static int tolua_write_reports(lua_State * L)
static int tolua_process_orders(lua_State * L)
{
UNUSED_ARG(L);
#if 0
order * ord = parse_order("@GIB xmis ALLES Gurgelkraut", default_locale);
assert(ord);
free_order(ord);
return 0;
#endif
processorders();
return 0;
}
@ -1154,7 +1160,6 @@ int eressea_run(lua_State *L, const char *luafile)
{
int err;
global.vm_state = L;
/* push an error handling function on the stack: */
lua_getglobal(L, "debug");
lua_getfield(L, -1, "traceback");

View File

@ -36,11 +36,11 @@ unit.test.c
SET(_DBFILES db/critbit.c)
IF(DB_FOUND)
SET(_DBFILES db/berkeley.c)
ELSEIF(SQLITE3_FOUND)
IF(SQLITE3_FOUND)
SET(_DBFILES db/sqlite.c)
ENDIF(DB_FOUND)
ELSEIF(DB_FOUND)
SET(_DBFILES db/berkeley.c)
ENDIF(SQLITE3_FOUND)
SET(_FILES
${_DBFILES}

View File

@ -40,6 +40,8 @@ int db_driver_order_save(struct order_data *od)
db_recno_t recno;
assert(od && od->_str);
memset(&key, 0, sizeof(DBT));
memset(&data, 0, sizeof(DBT));
key.data = &recno;
key.size = key.ulen = sizeof(recno);
key.flags = DB_DBT_USERMEM;