-
Notifications
You must be signed in to change notification settings - Fork 16
/
mpg123.patch
75 lines (71 loc) · 2.86 KB
/
mpg123.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
diff '--color=auto' -Naur mpg123-1.28.1-orig/configure.ac mpg123-1.28.1/configure.ac
--- mpg123-1.28.1-orig/configure.ac 2021-07-12 00:49:40.906632272 +0200
+++ mpg123-1.28.1/configure.ac 2021-07-12 00:52:50.956634812 +0200
@@ -1318,6 +1318,20 @@
# Optionally use platform macros for byte swapping.
AC_CHECK_HEADERS([byteswap.h])
+if test x"$ac_cv_header_sys_signal_h" = xyes; then
+ AC_CHECK_FUNCS( sigemptyset sigaddset sigprocmask sigaction )
+ if test x"$ac_cv_func_sigemptyset" = xno ||
+ test x"$ac_cv_func_sigaddset" = xno ||
+ test x"$ac_cv_func_sigprocmask" = xno ||
+ test x"$ac_cv_func_sigaction" = xno; then
+ AC_DEFINE(DONT_CATCH_SIGNALS, 1, [ Signal handling is not supported on this platform ])
+ fi
+else
+ AC_DEFINE(DONT_CATCH_SIGNALS, 1, [ Signal handling is not supported on this platform ])
+fi
+
+AC_CHECK_FUNCS( sleep, [ have_sleep=yes ], [ have_sleep=no ] )
+
dnl ############## Choose compiler flags and CPU
# do not assume gcc here, so no flags by default
diff '--color=auto' -Naur mpg123-1.28.1-orig/src/compat/compat.h mpg123-1.28.1/src/compat/compat.h
--- mpg123-1.28.1-orig/src/compat/compat.h 2021-07-12 00:49:40.876632271 +0200
+++ mpg123-1.28.1/src/compat/compat.h 2021-07-12 00:52:50.956634812 +0200
@@ -86,7 +86,8 @@
#include <sys/time.h>
#endif
/* For select(), I need select.h according to POSIX 2001, else: sys/time.h sys/types.h unistd.h */
-#ifdef HAVE_SYS_SELECT_H
+/* PSP2: Including sys/select.h results in fd_set undefined error */
+#if defined(HAVE_SYS_SELECT_H) && !defined(PSP2)
#include <sys/select.h>
#endif
diff '--color=auto' -Naur mpg123-1.28.1-orig/src/control_generic.c mpg123-1.28.1/src/control_generic.c
--- mpg123-1.28.1-orig/src/control_generic.c 2021-07-12 00:49:40.876632271 +0200
+++ mpg123-1.28.1/src/control_generic.c 2021-07-12 00:54:20.726636012 +0200
@@ -28,8 +28,10 @@
#include <ctype.h>
#if !defined (WIN32) || defined (__CYGWIN__)
#include <sys/wait.h>
+#ifdef NETWORK
#include <sys/socket.h>
#endif
+#endif
#include <errno.h>
#include <string.h>
@@ -397,7 +399,10 @@
outstream = stdout;
out_is_term = stdout_is_term;
}
-#ifndef _WIN32
+#if defined(GEKKO) || defined(_3DS) || defined(__SWITCH__)
+ fprintf(outstream, "The control interface is not supported on this platform\n");
+ return 0;
+#elif !defined(WIN32)
setlinebuf(outstream);
#else /* perhaps just use setvbuf as it's C89 */
/*
diff '--color=auto' -Naur mpg123-1.28.1-orig/src/mpg123.c mpg123-1.28.1/src/mpg123.c
--- mpg123-1.28.1-orig/src/mpg123.c 2021-07-12 00:49:40.876632271 +0200
+++ mpg123-1.28.1/src/mpg123.c 2021-07-12 00:52:50.956634812 +0200
@@ -1353,6 +1353,8 @@
if(param.verbose > 2) fprintf(stderr, "Note: pausing %i seconds before next track.\n", param.delay);
#ifdef WIN32
Sleep(param.delay*1000);
+#elif !defined(HAVE_SLEEP)
+ fprintf(stderr, "sleep not supported on this platform\n");
#else
sleep(param.delay);
#endif