From 1eed84099a8ea6b7bec9167f19d865ab52d6695f Mon Sep 17 00:00:00 2001 From: Kevin van der Vlist Date: Tue, 7 Jun 2011 23:13:58 +0200 Subject: OpenIndian b148 support (and perhaps other Solaris builds). --- configure.ac | 5 +++++ main.c | 8 ++++---- playlist.c | 5 ++++- plugins.c | 2 +- plugins/artwork/albumartorg.c | 3 +++ plugins/artwork/artwork.c | 8 ++++++++ plugins/artwork/lastfm.c | 3 +++ plugins/mms/libmms/bswap.h | 11 +++++++++++ plugins/shellexec/shellexec.c | 4 +++- plugins/sndfile/sndfile.c | 3 +++ plugins/vorbis/vorbis.c | 6 +++--- plugins/wildmidi/src/wildmidi_lib.c | 5 +++-- utf8.c | 6 ++++++ 13 files changed, 57 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 2f15a13b..64874ab7 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,11 @@ fi dnl check for libdl AC_CHECK_LIB([dl], [main], [HAVE_DL=yes;DL_LIBS="-ldl";AC_SUBST(DL_LIBS)]) +dnl check libsocket (OpenIndiana) +AC_CHECK_LIB([socket], [main], [HAVE_SOCKET=yes;DL_LIBS="-lsocket";AC_SUBST(DL_LIBS)]) +dnl check for seperate alloca.h (OpenIndiana) +AC_CHECK_HEADER([alloca.h],[],[alloca.h not found.]) + if test "x$enable_portable" != "xno" && test "x$enable_staticlink" != "xno" ; then AC_DEFINE_UNQUOTED([PORTABLE], [1], [Define if building portable version]) PORTABLE=yes diff --git a/main.c b/main.c index 2a4d220e..db8205fa 100644 --- a/main.c +++ b/main.c @@ -15,6 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +# include +#endif #include #include #include @@ -26,7 +29,7 @@ #include #endif #ifndef __linux__ -#define _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 1 #endif #include #include @@ -41,9 +44,6 @@ #ifdef __linux__ #include #endif -#ifdef HAVE_CONFIG_H -# include -#endif #include #include "gettext.h" #include "playlist.h" diff --git a/playlist.c b/playlist.c index 390cd133..9aee5540 100644 --- a/playlist.c +++ b/playlist.c @@ -18,6 +18,9 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#ifdef HAVE_ALLOCA_H +# include +#endif #include #include #include @@ -31,7 +34,7 @@ #include #include #ifndef __linux__ -#define _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 1 #endif #include #include diff --git a/plugins.c b/plugins.c index 53436f9a..38abace1 100644 --- a/plugins.c +++ b/plugins.c @@ -24,7 +24,7 @@ //#include #include #ifndef __linux__ -#define _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 1 #endif #include #ifdef HAVE_CONFIG_H diff --git a/plugins/artwork/albumartorg.c b/plugins/artwork/albumartorg.c index ada7179f..51ca54cb 100644 --- a/plugins/artwork/albumartorg.c +++ b/plugins/artwork/albumartorg.c @@ -16,6 +16,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +# include +#endif #include #include #include diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c index c2a8b766..7f56b870 100644 --- a/plugins/artwork/artwork.c +++ b/plugins/artwork/artwork.c @@ -1,3 +1,6 @@ +#ifdef HAVE_CONFIG_H +# include +#endif #include #include #include @@ -721,6 +724,11 @@ static const char *filter_custom_mask = NULL; static int filter_custom (const struct dirent *f) { +// FNM_CASEFOLD is not defined on solaris. On other platforms it is. +// It should be safe to define it as FNM_INGORECASE if it isn't defined. +#ifndef FNM_CASEFOLD +#define FNM_CASEFOLD FNM_IGNORECASE +#endif if (!fnmatch (filter_custom_mask, f->d_name, FNM_CASEFOLD)) { return 1; } diff --git a/plugins/artwork/lastfm.c b/plugins/artwork/lastfm.c index 2e78fd87..91972c8a 100644 --- a/plugins/artwork/lastfm.c +++ b/plugins/artwork/lastfm.c @@ -1,3 +1,6 @@ +#ifdef HAVE_CONFIG_H +# include +#endif #include #include #include diff --git a/plugins/mms/libmms/bswap.h b/plugins/mms/libmms/bswap.h index 6a6e1d10..7fe6db62 100644 --- a/plugins/mms/libmms/bswap.h +++ b/plugins/mms/libmms/bswap.h @@ -271,6 +271,17 @@ #define GINT16_TO_LE(val) (val) #endif +/* If this is not defined, we are on Solaris */ +#ifndef u_int16_t +#define u_int16_t uint16_t +#endif +#ifndef u_int32_t +#define u_int32_t uint32_t +#endif +#ifndef u_int64_t +#define u_int64_t uint64_t +#endif + #define LE_16(val) (GINT16_FROM_LE (*((u_int16_t*)(val)))) #define BE_16(val) (GINT16_FROM_BE (*((u_int16_t*)(val)))) #define LE_32(val) (GINT32_FROM_LE (*((u_int32_t*)(val)))) diff --git a/plugins/shellexec/shellexec.c b/plugins/shellexec/shellexec.c index 8ecf223e..76d31e34 100644 --- a/plugins/shellexec/shellexec.c +++ b/plugins/shellexec/shellexec.c @@ -37,7 +37,9 @@ remote - command allowed only for non-local files disabled - ignore command */ - +#ifdef HAVE_CONFIG_H +# include +#endif #include #include #include diff --git a/plugins/sndfile/sndfile.c b/plugins/sndfile/sndfile.c index bca91bab..eae39b86 100644 --- a/plugins/sndfile/sndfile.c +++ b/plugins/sndfile/sndfile.c @@ -16,6 +16,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +# include +#endif #ifndef __linux__ #define _LARGEFILE64_SOURCE #endif diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c index c85a0c63..f12123ee 100644 --- a/plugins/vorbis/vorbis.c +++ b/plugins/vorbis/vorbis.c @@ -15,6 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#ifdef HAVE_CONFIG_H +# include +#endif #include #include #include @@ -23,9 +26,6 @@ #include #include #include -#ifdef HAVE_CONFIG_H -# include -#endif #include "../../deadbeef.h" #include "vcedit.h" diff --git a/plugins/wildmidi/src/wildmidi_lib.c b/plugins/wildmidi/src/wildmidi_lib.c index 97912c50..66a2ca4a 100644 --- a/plugins/wildmidi/src/wildmidi_lib.c +++ b/plugins/wildmidi/src/wildmidi_lib.c @@ -137,7 +137,9 @@ ======================================== */ - +#ifdef HAVE_CONFIG_H +# include +#endif #include #include #include @@ -155,7 +157,6 @@ #ifdef _WIN32 # include #endif -#include "config.h" #include "wildmidi_lib.h" /* diff --git a/utf8.c b/utf8.c index 4efb2ea6..6165742e 100644 --- a/utf8.c +++ b/utf8.c @@ -19,6 +19,12 @@ by Jeff Bezanson placed in the public domain Fall 2005 */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif +#ifdef HAVE_ALLOCA_H +# include +#endif #include #include #include -- cgit v1.2.3