diff options
-rw-r--r-- | junklib.c | 22 | ||||
-rw-r--r-- | main.c | 12 | ||||
-rw-r--r-- | plugins.c | 9 | ||||
-rw-r--r-- | plugins/sndfile/sndfile.c | 3 | ||||
-rw-r--r-- | streamer.c | 4 |
5 files changed, 48 insertions, 2 deletions
@@ -298,7 +298,11 @@ convstr_id3v2_2to3 (const unsigned char* str, int sz) { else { size_t inbytesleft = sz; size_t outbytesleft = 2047; +#ifdef __linux__ char *pin = (char*)str; +#else + const char *pin = str; +#endif char *pout = out; memset (out, 0, sizeof (out)); /*size_t res = */iconv (cd, &pin, &inbytesleft, &pout, &outbytesleft); @@ -355,7 +359,11 @@ convstr_id3v2_4 (const unsigned char* str, int sz) { else { size_t inbytesleft = sz; size_t outbytesleft = 2047; +#ifdef __linux__ char *pin = (char*)str; +#else + const char *pin = str; +#endif char *pout = out; memset (out, 0, sizeof (out)); /*size_t res = */iconv (cd, &pin, &inbytesleft, &pout, &outbytesleft); @@ -385,7 +393,11 @@ convstr_id3v1 (const char* str, int sz) { cd = iconv_open ("utf8", "utf8"); size_t inbytesleft = sz; size_t outbytesleft = 2047; - char *pin = (char*)str; +#ifdef __linux__ + char *pin = (char*)str; +#else + const char *pin = str; +#endif char *pout = out; memset (out, 0, sizeof (out)); size_t res = iconv (cd, &pin, &inbytesleft, &pout, &outbytesleft); @@ -408,7 +420,11 @@ convstr_id3v1 (const char* str, int sz) { else { size_t inbytesleft = sz; size_t outbytesleft = 2047; +#ifdef __linux__ char *pin = (char*)str; +#else + const char *pin = str; +#endif char *pout = out; memset (out, 0, sizeof (out)); /*size_t res = */iconv (cd, &pin, &inbytesleft, &pout, &outbytesleft); @@ -1287,7 +1303,11 @@ junk_recode (const char *in, int inlen, char *out, int outlen, const char *cs) { else { size_t inbytesleft = inlen; size_t outbytesleft = outlen; +#ifdef __linux__ char *pin = (char*)in; +#else + const char *pin = in; +#endif char *pout = out; memset (out, 0, outlen); size_t res = iconv (cd, &pin, &inbytesleft, &pout, &outbytesleft); @@ -20,7 +20,14 @@ #include <string.h> #include <stdlib.h> #include <time.h> +#ifdef __linux__ +#include <sys/prctl.h> +#endif +#ifndef __linux__ +#define _POSIX_C_SOURCE +#endif #include <limits.h> +#include <errno.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/types.h> @@ -28,7 +35,6 @@ #include <sys/un.h> #include <sys/fcntl.h> #include <sys/errno.h> -#include <sys/prctl.h> #include <signal.h> #ifdef HAVE_CONFIG_H # include <config.h> @@ -45,6 +51,10 @@ #include "session.h" #include "plugins.h" +#ifndef PATH_MAX +#define PATH_MAX 1024 /* max # of characters in a path name */ +#endif + #ifndef PREFIX #error PREFIX must be defined #endif @@ -21,7 +21,12 @@ #include <assert.h> #include <stdio.h> #include <stdlib.h> +#include <alloca.h> #include <string.h> +#ifndef __linux__ +#define _POSIX_C_SOURCE +#endif +#include <limits.h> #ifdef HAVE_CONFIG_H # include <config.h> #endif @@ -38,6 +43,10 @@ #include "junklib.h" #include "vfs.h" +#ifndef PATH_MAX +#define PATH_MAX 1024 /* max # of characters in a path name */ +#endif + //#define DISABLE_VERSIONCHECK 1 static uintptr_t mutex; diff --git a/plugins/sndfile/sndfile.c b/plugins/sndfile/sndfile.c index e6dfb7ce..2b33d8ce 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. */ +#ifndef __linux__ +#define _LARGEFILE64_SOURCE +#endif #include <string.h> #include <sndfile.h> #include "../../deadbeef.h" @@ -21,7 +21,9 @@ #include <assert.h> #include <unistd.h> #include <samplerate.h> +#ifdef __linux__ #include <sys/prctl.h> +#endif #include <sys/time.h> #include "threading.h" #include "codec.h" @@ -257,7 +259,9 @@ streamer_read_async (char *bytes, int size); void streamer_thread (void *ctx) { +#ifdef __linux__ prctl (PR_SET_NAME, "deadbeef-stream", 0, 0, 0, 0); +#endif codecleft = 0; while (!streaming_terminate) { |