* Make some necessary changes to function on old OSes (like CentOS 5.7).
This commit is contained in:
parent
f210260956
commit
c415fbdbf3
@ -369,7 +369,9 @@ for dir in "" /usr/local $SEARCH_DIR; do
|
|||||||
if test -n "$dir"; then
|
if test -n "$dir"; then
|
||||||
LDFLAGS="$LDFLAGS -L$dir/lib"
|
LDFLAGS="$LDFLAGS -L$dir/lib"
|
||||||
fi
|
fi
|
||||||
AC_CHECK_LIB([sqlite3], [sqlite3_open], [LIBSQLITE3_LIBS="-lsqlite3"], [unset ac_cv_lib_sqlite3_sqlite3_open; LDFLAGS="$LDFLAGS_SAVE"; continue])
|
AC_CHECK_LIB(sqlite3, sqlite3_open, [LIBSQLITE3_LIBS="-lsqlite3"], [unset ac_cv_lib_sqlite3_sqlite3_open; LDFLAGS="$LDFLAGS_SAVE"; continue])
|
||||||
|
AC_CHECK_LIB(sqlite3, sqlite3_malloc, [AC_DEFINE([HAVE_SQLITE3_MALLOC], [1], [Define to 1 if the sqlite3_malloc function exists.])])
|
||||||
|
AC_CHECK_LIB(sqlite3, sqlite3_prepare_v2, [AC_DEFINE([HAVE_SQLITE3_PREPARE_V2], [1], [Define to 1 if the sqlite3_prepare_v2 function exists.])])
|
||||||
break
|
break
|
||||||
done
|
done
|
||||||
test x"$ac_cv_lib_sqlite3_sqlite3_open" = x"yes" || AC_MSG_ERROR([Could not find libsqlite3])
|
test x"$ac_cv_lib_sqlite3_sqlite3_open" = x"yes" || AC_MSG_ERROR([Could not find libsqlite3])
|
||||||
|
@ -314,7 +314,7 @@ free_metadata(metadata_t * m, uint32_t flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sqlite_int64
|
sqlite_int64
|
||||||
GetFolderMetadata(const char * name, const char * path, const char * artist, const char * genre, sqlite3_int64 album_art)
|
GetFolderMetadata(const char * name, const char * path, const char * artist, const char * genre, sqlite_int64 album_art)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ void
|
|||||||
check_for_captions(const char * path, sqlite_int64 detailID);
|
check_for_captions(const char * path, sqlite_int64 detailID);
|
||||||
|
|
||||||
sqlite_int64
|
sqlite_int64
|
||||||
GetFolderMetadata(const char * name, const char * path, const char * artist, const char * genre, sqlite3_int64 album_art);
|
GetFolderMetadata(const char * name, const char * path, const char * artist, const char * genre, sqlite_int64 album_art);
|
||||||
|
|
||||||
sqlite_int64
|
sqlite_int64
|
||||||
GetAudioMetadata(const char * path, char * name);
|
GetAudioMetadata(const char * path, char * name);
|
||||||
|
@ -54,7 +54,7 @@ int valid_cache = 0;
|
|||||||
|
|
||||||
struct virtual_item
|
struct virtual_item
|
||||||
{
|
{
|
||||||
sqlite3_int64 objectID;
|
sqlite_int64 objectID;
|
||||||
char parentID[64];
|
char parentID[64];
|
||||||
char name[256];
|
char name[256];
|
||||||
};
|
};
|
||||||
@ -81,7 +81,7 @@ get_next_available_id(const char * table, const char * parentID)
|
|||||||
|
|
||||||
int
|
int
|
||||||
insert_container(const char * item, const char * rootParent, const char * refID, const char *class,
|
insert_container(const char * item, const char * rootParent, const char * refID, const char *class,
|
||||||
const char *artist, const char *genre, const char *album_art, sqlite3_int64 *objectID, sqlite3_int64 *parentID)
|
const char *artist, const char *genre, const char *album_art, sqlite_int64 *objectID, sqlite_int64 *parentID)
|
||||||
{
|
{
|
||||||
char *result;
|
char *result;
|
||||||
char *base;
|
char *base;
|
||||||
@ -130,7 +130,7 @@ insert_container(const char * item, const char * rootParent, const char * refID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
insert_containers(const char * name, const char *path, const char * refID, const char * class, sqlite3_int64 detailID)
|
insert_containers(const char * name, const char *path, const char * refID, const char * class, sqlite_int64 detailID)
|
||||||
{
|
{
|
||||||
char *sql;
|
char *sql;
|
||||||
char **result;
|
char **result;
|
||||||
@ -465,7 +465,7 @@ insert_file(char * name, const char * path, const char * parentID, int object)
|
|||||||
{
|
{
|
||||||
char class[32];
|
char class[32];
|
||||||
char objectID[64];
|
char objectID[64];
|
||||||
sqlite3_int64 detailID = 0;
|
sqlite_int64 detailID = 0;
|
||||||
char base[8];
|
char base[8];
|
||||||
char * typedir_parentID;
|
char * typedir_parentID;
|
||||||
int typedir_objectID;
|
int typedir_objectID;
|
||||||
|
7
sql.h
7
sql.h
@ -26,6 +26,13 @@
|
|||||||
|
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
|
|
||||||
|
#ifndef HAVE_SQLITE3_MALLOC
|
||||||
|
#define sqlite3_malloc(size) sqlite3_mprintf("%*s", size, "")
|
||||||
|
#endif
|
||||||
|
#ifndef HAVE_SQLITE3_PREPARE_V2
|
||||||
|
#define sqlite3_prepare_v2 sqlite3_prepare
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
sql_exec(sqlite3 *db, const char *fmt, ...);
|
sql_exec(sqlite3 *db, const char *fmt, ...);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user