summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--junklib.c22
-rw-r--r--main.c12
-rw-r--r--plugins.c9
-rw-r--r--plugins/sndfile/sndfile.c3
-rw-r--r--streamer.c4
5 files changed, 48 insertions, 2 deletions
diff --git a/junklib.c b/junklib.c
index d6e3c63e..98f7471e 100644
--- a/junklib.c
+++ b/junklib.c
@@ -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);
diff --git a/main.c b/main.c
index de00f988..ab2b0a13 100644
--- a/main.c
+++ b/main.c
@@ -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
diff --git a/plugins.c b/plugins.c
index 384512c4..0a66b9c1 100644
--- a/plugins.c
+++ b/plugins.c
@@ -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 0202439e..d44b8e16 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"
diff --git a/streamer.c b/streamer.c
index a196e33a..46426f9a 100644
--- a/streamer.c
+++ b/streamer.c
@@ -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) {