diff options
author | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-09-17 03:39:57 +0400 |
---|---|---|
committer | Justin Maggard <jmaggard@users.sourceforce.net> | 2011-09-17 03:39:57 +0400 |
commit | b81ff08b0ce5b99768f04c17002005bad5e20c07 (patch) | |
tree | 4cba796c6de01aeb93251589bfe21fe5288cfcaa /tagutils | |
parent | 44f26df01df3ad565be9b9aa7df918f4b2bbeb5e (diff) |
* Add support for other operating systems (kFreeBSD, FreeBSD, and OSX for now).
* Switch to autoconf from genconfig.sh.
Diffstat (limited to 'tagutils')
-rw-r--r-- | tagutils/misc.c | 5 | ||||
-rw-r--r-- | tagutils/tagutils-asf.h | 4 | ||||
-rw-r--r-- | tagutils/tagutils-misc.c | 8 | ||||
-rw-r--r-- | tagutils/tagutils-mp3.c | 9 | ||||
-rw-r--r-- | tagutils/tagutils.c | 2 | ||||
-rw-r--r-- | tagutils/tagutils.h | 1 |
6 files changed, 18 insertions, 11 deletions
diff --git a/tagutils/misc.c b/tagutils/misc.c index 08e00ae..f439b8c 100644 --- a/tagutils/misc.c +++ b/tagutils/misc.c @@ -19,9 +19,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" #include <stdio.h> #include <string.h> +#ifdef HAVE_MACHINE_ENDIAN_H +#include <machine/endian.h> +#else #include <endian.h> +#endif #include "misc.h" diff --git a/tagutils/tagutils-asf.h b/tagutils/tagutils-asf.h index 5fd2942..91fcaa2 100644 --- a/tagutils/tagutils-asf.h +++ b/tagutils/tagutils-asf.h @@ -23,7 +23,11 @@ #define __PACKED__ __attribute__((packed)) +#ifdef HAVE_MACHINE_ENDIAN_H +#include <machine/endian.h> +#else #include <endian.h> +#endif typedef struct _GUID { __u32 l; diff --git a/tagutils/tagutils-misc.c b/tagutils/tagutils-misc.c index 9934e7a..eef242b 100644 --- a/tagutils/tagutils-misc.c +++ b/tagutils/tagutils-misc.c @@ -33,10 +33,10 @@ typedef enum { static iconv_result do_iconv(const char* to_ces, const char* from_ces, - char *inbuf, size_t inbytesleft, + ICONV_CONST char *inbuf, size_t inbytesleft, char *outbuf_orig, size_t outbytesleft_orig) { -#ifdef HAVE_ICONV_H +#ifdef HAVE_ICONV size_t rc; iconv_result ret = ICONV_OK; @@ -65,9 +65,9 @@ do_iconv(const char* to_ces, const char* from_ces, iconv_close(cd); return ret; -#else // HAVE_ICONV_H +#else // HAVE_ICONV return ICONV_FATAL; -#endif // HAVE_ICONV_H +#endif // HAVE_ICONV } #define N_LANG_ALT 8 diff --git a/tagutils/tagutils-mp3.c b/tagutils/tagutils-mp3.c index 643b349..6998147 100644 --- a/tagutils/tagutils-mp3.c +++ b/tagutils/tagutils-mp3.c @@ -232,8 +232,7 @@ _get_mp3tags(char *file, struct song_metadata *psong) if((utf8_text) && (strncasecmp((char*)utf8_text, "iTun", 4) != 0)) { // read comment - if(utf8_text) - free(utf8_text); + free(utf8_text); native_text = id3_field_getfullstring(&pid3frame->fields[3]); if(native_text) @@ -241,16 +240,14 @@ _get_mp3tags(char *file, struct song_metadata *psong) utf8_text = (unsigned char*)id3_ucs4_utf8duplicate(native_text); if(utf8_text) { - if (psong->comment) - free(psong->comment); + free(psong->comment); psong->comment = (char*)utf8_text; } } } else { - if(utf8_text) - free(utf8_text); + free(utf8_text); } } } diff --git a/tagutils/tagutils.c b/tagutils/tagutils.c index 7e147e7..9813bfc 100644 --- a/tagutils/tagutils.c +++ b/tagutils/tagutils.c @@ -37,7 +37,7 @@ #include <FLAC/metadata.h> #include "../config.h" -#ifdef HAVE_ICONV_H +#ifdef HAVE_ICONV #include <iconv.h> #endif diff --git a/tagutils/tagutils.h b/tagutils/tagutils.h index 0d5f362..0c884be 100644 --- a/tagutils/tagutils.h +++ b/tagutils/tagutils.h @@ -30,6 +30,7 @@ #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> +#include <libgen.h> #define ROLE_NOUSE 0 #define ROLE_START 1 |