diff options
author | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-12-07 07:55:20 +0400 |
---|---|---|
committer | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-12-07 07:55:20 +0400 |
commit | 0e5a7974400ca682fa2a842f8f238949f8d6ae58 (patch) | |
tree | 58d40778de2768d51db1a7bde7ac93f257b7889a | |
parent | 51d900317928a045acf77557d9f7824467699299 (diff) |
* Make some necessary changes to function on old OSes (like CentOS 5.7).
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | metadata.c | 2 | ||||
-rw-r--r-- | metadata.h | 2 | ||||
-rw-r--r-- | scanner.c | 8 | ||||
-rw-r--r-- | sql.h | 7 |
5 files changed, 16 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 736be5c..9dd7d8d 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) @@ -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; @@ -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); @@ -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; @@ -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, ...); |