mpg123: mpg123-1.32.5

From 73caa15ce904a3a687c0043c5cd20edf619d4a70 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sat, 17 Feb 2024 21:28:24 +0300
Subject: [PATCH] mpg123-1.32.5

---
 NEWS                                          | 12 +++++++++++
 configure                                     | 20 +++++++++----------
 mpg123.spec                                   |  2 +-
 .../src/libout123/modules/CMakeLists.txt      |  6 +++---
 ports/cmake/src/libsyn123/CMakeLists.txt      |  1 +
 src/include/mpg123.h                          |  2 +-
 src/libmpg123/getcpuflags_arm.c               |  8 +++++++-
 src/libmpg123/layer3.c                        | 10 +++++-----
 src/libmpg123/libmpg123.c                     |  3 ++-
 src/version.h                                 |  2 +-
 10 files changed, 43 insertions(+), 23 deletions(-)

diff --git a/NEWS b/NEWS
index 05dd0b8..514a7b3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,15 @@
+1.32.5
+------
+
+- build:
+-- CMake port uses CFLAGS for pulse/jack/tinyalsa properly now (bug 366).
+-- CMake port links libsyn123 with libm now (bug 370).
+- libmpg123:
+-- Fix --enable-portable (no usage of LFS_WRAP_NONE, bug 368).
+-- Fix dct36 wrapper usage for x86-64 and NEON. Stupid (bug 367) and
+   also avoid returning void.
+-- Make ARM builds work with nagging (missing feature macros for std=c99).
+
 1.32.4
 ------
 - build:
diff --git a/configure b/configure
index 1fdd3df..15748ad 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for mpg123 1.32.4.
+# Generated by GNU Autoconf 2.71 for mpg123 1.32.5.
 #
 # Report bugs to <maintainer@mpg123.org>.
 #
@@ -621,8 +621,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='mpg123'
 PACKAGE_TARNAME='mpg123'
-PACKAGE_VERSION='1.32.4'
-PACKAGE_STRING='mpg123 1.32.4'
+PACKAGE_VERSION='1.32.5'
+PACKAGE_STRING='mpg123 1.32.5'
 PACKAGE_BUGREPORT='maintainer@mpg123.org'
 PACKAGE_URL=''
 
@@ -1727,7 +1727,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures mpg123 1.32.4 to adapt to many kinds of systems.
+\`configure' configures mpg123 1.32.5 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1798,7 +1798,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mpg123 1.32.4:";;
+     short | recursive ) echo "Configuration of mpg123 1.32.5:";;
    esac
   cat <<\_ACEOF
 
@@ -2076,7 +2076,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mpg123 configure 1.32.4
+mpg123 configure 1.32.5
 generated by GNU Autoconf 2.71
 
 Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2621,7 +2621,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mpg123 $as_me 1.32.4, which was
+It was created by mpg123 $as_me 1.32.5, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -3991,7 +3991,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='mpg123'
- VERSION='1.32.4'
+ VERSION='1.32.5'
 
 
 printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -22430,7 +22430,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mpg123 $as_me 1.32.4, which was
+This file was extended by mpg123 $as_me 1.32.5, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -22498,7 +22498,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-mpg123 config.status 1.32.4
+mpg123 config.status 1.32.5
 configured by $0, generated by GNU Autoconf 2.71,
   with options \\"\$ac_cs_config\\"
 
diff --git a/mpg123.spec b/mpg123.spec
index b340ce2..ebb4e0e 100644
--- a/mpg123.spec
+++ b/mpg123.spec
@@ -3,7 +3,7 @@
 # - devel packages for alsa, sdl, etc... to build the respective output modules.
 Summary:	The fast console mpeg audio decoder/player.
 Name:		mpg123
-Version:	1.32.4
+Version:	1.32.5
 Release:	1
 URL:		http://www.mpg123.org/
 License:	GPL
diff --git a/ports/cmake/src/libout123/modules/CMakeLists.txt b/ports/cmake/src/libout123/modules/CMakeLists.txt
index 21810c6..51c673d 100644
--- a/ports/cmake/src/libout123/modules/CMakeLists.txt
+++ b/ports/cmake/src/libout123/modules/CMakeLists.txt
@@ -17,11 +17,11 @@ if(NOT USE_MODULES)
         $<$<STREQUAL:${DEFAULT_OUTPUT_MODULE},win32>:${WIN32_LIBRARIES}>
         $<$<STREQUAL:${DEFAULT_OUTPUT_MODULE},win32_wasapi>:${WIN32_WASAPI_LIBRARIES}>)
     if(DEFAULT_OUTPUT_MODULE STREQUAL "pulse")
-        target_compile_definitions(defaultmodule PRIVATE ${PULSE_CFLAGS})
+        target_compile_options(defaultmodule PRIVATE ${PULSE_CFLAGS})
     elseif(DEFAULT_OUTPUT_MODULE STREQUAL "jack")
-        target_compile_definitions(defaultmodule PRIVATE ${JACK_CFLAGS})
+        target_compile_options(defaultmodule PRIVATE ${JACK_CFLAGS})
     elseif(DEFAULT_OUTPUT_MODULE STREQUAL "tinyalsa")
-        target_compile_definitions(defaultmodule PRIVATE ${TINYALSA_CFLAGS})
+        target_compile_options(defaultmodule PRIVATE ${TINYALSA_CFLAGS})
     endif()
     if(BUILD_SHARED_LIBS)
         set_target_properties(defaultmodule PROPERTIES POSITION_INDEPENDENT_CODE ON)
diff --git a/ports/cmake/src/libsyn123/CMakeLists.txt b/ports/cmake/src/libsyn123/CMakeLists.txt
index 5c0ae0b..6edb5b7 100644
--- a/ports/cmake/src/libsyn123/CMakeLists.txt
+++ b/ports/cmake/src/libsyn123/CMakeLists.txt
@@ -20,6 +20,7 @@ target_include_directories(${TARGET} INTERFACE
     "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
 
 target_link_libraries(${TARGET} PRIVATE
+    $<$<BOOL:${HAVE_M}>:m>
     $<$<BOOL:${WANT_WIN32_UNICODE}>:shlwapi>)
 
 install(TARGETS ${TARGET} EXPORT targets
diff --git a/src/include/mpg123.h b/src/include/mpg123.h
index 90d1c91..bc89d4b 100644
--- a/src/include/mpg123.h
+++ b/src/include/mpg123.h
@@ -1327,7 +1327,7 @@ MPG123_EXPORT int mpg123_volume_change(mpg123_handle *mh, double change);
 
 /** Adjust output volume including the RVA setting by chosen amount
  *  \param mh handle
- *  \param change volume adjustment in decibels (limited to +/- 60 dB)
+ *  \param db volume adjustment in decibels (limited to +/- 60 dB)
  *  \return MPG123_OK on success
  */
 MPG123_EXPORT int mpg123_volume_change_db(mpg123_handle *mh, double db);
diff --git a/src/libmpg123/getcpuflags_arm.c b/src/libmpg123/getcpuflags_arm.c
index 342c217..8d0249a 100644
--- a/src/libmpg123/getcpuflags_arm.c
+++ b/src/libmpg123/getcpuflags_arm.c
@@ -1,11 +1,17 @@
 /*
 	getcpuflags_arm: get cpuflags for ARM
 
-	copyright 1995-2014 by the mpg123 project - free software under the terms of the LGPL 2.1
+	copyright 1995-2024 by the mpg123 project - free software under the terms of the LGPL 2.1
 	see COPYING and AUTHORS files in distribution or http://mpg123.org
 	initially written by Taihei Momma
 */
 
+// For sigsetjmp, we need POSIX 2001
+#define _POSIX_C_SOURCE 200112L
+// For SA_RESTART, XSI is needed (or POSIX 2008).
+// This here should include the above, keeping that for clarity.
+#define _XOPEN_SOURCE 600
+
 #include <setjmp.h>
 #include <signal.h>
 #include "mpg123lib_intern.h"
diff --git a/src/libmpg123/layer3.c b/src/libmpg123/layer3.c
index c49dbba..6640f38 100644
--- a/src/libmpg123/layer3.c
+++ b/src/libmpg123/layer3.c
@@ -1466,7 +1466,7 @@ static void INT123_dct36(real *inbuf,real *o1,real *o2,const real *wintab,real *
 #define DCT36_WRAP(asmfunc) \
 static void asmfunc ## _wrap(real *inbuf,real *o1,real *o2,const real *wintab,real *tsbuf) \
 { \
-	return asmfunc(inbuf, o1, o2, wintab, tsbuf); \
+	asmfunc(inbuf, o1, o2, wintab, tsbuf); \
 }
 
 #ifdef OPT_SSE
@@ -1529,22 +1529,22 @@ void INT123_dct36_choose(mpg123_handle *fr)
 #endif
 #ifdef OPT_AVX
 	case avx:
-		fr->cpu_opts.the_dct36 = INT123_dct36_avx;
+		fr->cpu_opts.the_dct36 = INT123_dct36_avx_wrap;
 	break;
 #endif
 #ifdef OPT_X86_64
 	case x86_64:
-		fr->cpu_opts.the_dct36 = INT123_dct36_x86_64;
+		fr->cpu_opts.the_dct36 = INT123_dct36_x86_64_wrap;
 	break;
 #endif
 #ifdef OPT_NEON
 	case neon:
-		fr->cpu_opts.the_dct36 = INT123_dct36_neon;
+		fr->cpu_opts.the_dct36 = INT123_dct36_neon_wrap;
 	break;
 #endif
 #ifdef OPT_NEON64
 	case neon:
-		fr->cpu_opts.the_dct36 = INT123_dct36_neon64;
+		fr->cpu_opts.the_dct36 = INT123_dct36_neon64_wrap;
 	break;
 #endif
 	default:
diff --git a/src/libmpg123/libmpg123.c b/src/libmpg123/libmpg123.c
index 6792064..6cbd29e 100644
--- a/src/libmpg123/libmpg123.c
+++ b/src/libmpg123/libmpg123.c
@@ -648,9 +648,10 @@ int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle)
 #ifndef PORTABLE_API
 	ret = INT123_wrap_open( mh, iohandle, NULL, -1
 	,	mh->p.timeout, mh->p.flags & MPG123_QUIET );
+	iohandle = ret == LFS_WRAP_NONE ? iohandle : mh->wrapperdata;
 	if(ret >= 0)
 #endif
-		ret = INT123_open_stream_handle(mh, ret == LFS_WRAP_NONE ? iohandle : mh->wrapperdata);
+		ret = INT123_open_stream_handle(mh, iohandle);
 	return ret;
 }
 
diff --git a/src/version.h b/src/version.h
index 55bd65a..9a8d09f 100644
--- a/src/version.h
+++ b/src/version.h
@@ -16,7 +16,7 @@
 // only single spaces as separator to ease parsing by build scripts
 #define MPG123_MAJOR 1
 #define MPG123_MINOR 32
-#define MPG123_PATCH 4
+#define MPG123_PATCH 5
 // Don't get too wild with that to avoid confusing m4. No brackets.
 // Also, it should fit well into a sane file name for the tarball.
 #define MPG123_SUFFIX ""