* Make some necessary changes to function on old OSes (like CentOS 5.7).

This commit is contained in:
Justin Maggard 2011-12-07 03:55:20 +00:00
parent f210260956
commit c415fbdbf3
5 changed files with 16 additions and 7 deletions

View File

@ -369,7 +369,9 @@ for dir in "" /usr/local $SEARCH_DIR; do
if test -n "$dir"; then
LDFLAGS="$LDFLAGS -L$dir/lib"
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
done
test x"$ac_cv_lib_sqlite3_sqlite3_open" = x"yes" || AC_MSG_ERROR([Could not find libsqlite3])

View File

@ -314,7 +314,7 @@ free_metadata(metadata_t * m, uint32_t flags)
}
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;

View File

@ -88,7 +88,7 @@ void
check_for_captions(const char * path, sqlite_int64 detailID);
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
GetAudioMetadata(const char * path, char * name);

View File

@ -54,7 +54,7 @@ int valid_cache = 0;
struct virtual_item
{
sqlite3_int64 objectID;
sqlite_int64 objectID;
char parentID[64];
char name[256];
};
@ -81,7 +81,7 @@ get_next_available_id(const char * table, const char * parentID)
int
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 *base;
@ -130,7 +130,7 @@ insert_container(const char * item, const char * rootParent, const char * refID,
}
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 **result;
@ -465,7 +465,7 @@ insert_file(char * name, const char * path, const char * parentID, int object)
{
char class[32];
char objectID[64];
sqlite3_int64 detailID = 0;
sqlite_int64 detailID = 0;
char base[8];
char * typedir_parentID;
int typedir_objectID;

7
sql.h
View File

@ -26,6 +26,13 @@
#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
sql_exec(sqlite3 *db, const char *fmt, ...);