You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(1) |
Feb
(2) |
Mar
(3) |
Apr
(2) |
May
(10) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2008 |
Jan
(6) |
Feb
(4) |
Mar
(5) |
Apr
(2) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
(6) |
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(4) |
2009 |
Jan
(9) |
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(6) |
Jun
(18) |
Jul
(33) |
Aug
(39) |
Sep
(33) |
Oct
(24) |
Nov
(23) |
Dec
(22) |
2010 |
Jan
(29) |
Feb
(32) |
Mar
(51) |
Apr
(17) |
May
(31) |
Jun
(21) |
Jul
(32) |
Aug
(28) |
Sep
(35) |
Oct
(27) |
Nov
(11) |
Dec
(13) |
2011 |
Jan
(14) |
Feb
(13) |
Mar
(27) |
Apr
(27) |
May
(28) |
Jun
(20) |
Jul
(43) |
Aug
(52) |
Sep
(66) |
Oct
(61) |
Nov
(11) |
Dec
(8) |
2012 |
Jan
(20) |
Feb
(30) |
Mar
(38) |
Apr
(21) |
May
(33) |
Jun
(21) |
Jul
(25) |
Aug
(9) |
Sep
(24) |
Oct
(42) |
Nov
(27) |
Dec
(41) |
2013 |
Jan
(20) |
Feb
(35) |
Mar
(156) |
Apr
(298) |
May
(258) |
Jun
(201) |
Jul
(105) |
Aug
(60) |
Sep
(193) |
Oct
(245) |
Nov
(280) |
Dec
(194) |
2014 |
Jan
(63) |
Feb
(202) |
Mar
(200) |
Apr
(23) |
May
(53) |
Jun
(105) |
Jul
(18) |
Aug
(26) |
Sep
(110) |
Oct
(187) |
Nov
(97) |
Dec
(74) |
2015 |
Jan
(45) |
Feb
(55) |
Mar
(116) |
Apr
(116) |
May
(193) |
Jun
(164) |
Jul
(50) |
Aug
(111) |
Sep
(98) |
Oct
(71) |
Nov
(103) |
Dec
(63) |
2016 |
Jan
(33) |
Feb
(101) |
Mar
(182) |
Apr
(139) |
May
(140) |
Jun
(103) |
Jul
(165) |
Aug
(286) |
Sep
(208) |
Oct
(127) |
Nov
(97) |
Dec
(54) |
2017 |
Jan
(64) |
Feb
(335) |
Mar
(202) |
Apr
(212) |
May
(139) |
Jun
(127) |
Jul
(294) |
Aug
(154) |
Sep
(170) |
Oct
(152) |
Nov
(156) |
Dec
(62) |
2018 |
Jan
(168) |
Feb
(237) |
Mar
(196) |
Apr
(174) |
May
(174) |
Jun
(161) |
Jul
(127) |
Aug
(88) |
Sep
(149) |
Oct
(66) |
Nov
(52) |
Dec
(135) |
2019 |
Jan
(146) |
Feb
(126) |
Mar
(104) |
Apr
(58) |
May
(60) |
Jun
(28) |
Jul
(197) |
Aug
(129) |
Sep
(141) |
Oct
(148) |
Nov
(63) |
Dec
(100) |
2020 |
Jan
(74) |
Feb
(37) |
Mar
(59) |
Apr
(154) |
May
(194) |
Jun
(133) |
Jul
(313) |
Aug
(197) |
Sep
(49) |
Oct
(162) |
Nov
(143) |
Dec
(57) |
2021 |
Jan
(120) |
Feb
(107) |
Mar
(314) |
Apr
(157) |
May
(524) |
Jun
(169) |
Jul
(72) |
Aug
(133) |
Sep
(135) |
Oct
(146) |
Nov
(198) |
Dec
(325) |
2022 |
Jan
(409) |
Feb
(249) |
Mar
(138) |
Apr
(95) |
May
(102) |
Jun
(221) |
Jul
(66) |
Aug
(120) |
Sep
(192) |
Oct
(131) |
Nov
(53) |
Dec
(171) |
2023 |
Jan
(357) |
Feb
(82) |
Mar
(168) |
Apr
(218) |
May
(196) |
Jun
(86) |
Jul
(115) |
Aug
(49) |
Sep
(190) |
Oct
(102) |
Nov
(45) |
Dec
(76) |
2024 |
Jan
(86) |
Feb
(50) |
Mar
(324) |
Apr
(209) |
May
(197) |
Jun
(232) |
Jul
(194) |
Aug
(247) |
Sep
(219) |
Oct
(266) |
Nov
(328) |
Dec
(304) |
2025 |
Jan
(191) |
Feb
(115) |
Mar
(137) |
Apr
(32) |
May
(126) |
Jun
(403) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sv...@op...> - 2025-06-07 19:55:34
|
Author: manx Date: Sat Jun 7 21:55:23 2025 New Revision: 23426 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23426 Log: Merged revision(s) 23421 from trunk/OpenMPT: [Fix] mpg123: Exclude unneeded and broken strtok work-arounds. ........ Modified: branches/OpenMPT-1.28/ (props changed) branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt branches/OpenMPT-1.28/include/mpg123/ports/generic/config.h branches/OpenMPT-1.28/include/mpg123/src/compat/compat.h Modified: branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt Sat Jun 7 21:55:04 2025 (r23425) +++ branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt Sat Jun 7 21:55:23 2025 (r23426) @@ -3,7 +3,7 @@ * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified to + * `src/compat/compat.c` and `src/compat/compat.h` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.28/include/mpg123/ports/generic/config.h ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/ports/generic/config.h Sat Jun 7 21:55:04 2025 (r23425) +++ branches/OpenMPT-1.28/include/mpg123/ports/generic/config.h Sat Jun 7 21:55:23 2025 (r23426) @@ -99,6 +99,9 @@ /* libmpg123 does not care about file mode */ #define NO_FILEMODE +/* libmpg123 does not care about strtok */ +#define NO_STRTOK + /* We want some frame index, eh? */ #define FRAME_INDEX 1 #define INDEX_SIZE 1000 Modified: branches/OpenMPT-1.28/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/compat/compat.h Sat Jun 7 21:55:04 2025 (r23425) +++ branches/OpenMPT-1.28/include/mpg123/src/compat/compat.h Sat Jun 7 21:55:23 2025 (r23426) @@ -110,6 +110,7 @@ typedef unsigned char byte; +#ifndef NO_STRTOK /* OpenMPT */ // Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while // C11 declares another strtok_s with different prototype. Thanks to you all. #ifdef HAVE_STRTOK_R @@ -122,6 +123,7 @@ #define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) #endif #endif +#endif /* OpenMPT */ #if defined(MPG123_COMPAT_MSVCRT_IO) #if defined(_UCRT) @@ -159,10 +161,12 @@ #include <io.h> #endif +#ifndef NO_STRTOK /* OpenMPT */ #ifndef INT123_compat_strtok #warning "no safe strtok found" #define INT123_compat_strtok(a, b, c) strtok((a), (b)) #endif +#endif /* OpenMPT */ /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); |
From: <sv...@op...> - 2025-06-07 19:55:16
|
Author: manx Date: Sat Jun 7 21:55:04 2025 New Revision: 23425 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23425 Log: Merged revision(s) 23421 from trunk/OpenMPT: [Fix] mpg123: Exclude unneeded and broken strtok work-arounds. ........ Modified: branches/OpenMPT-1.29/ (props changed) branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt branches/OpenMPT-1.29/include/mpg123/ports/generic/config.h branches/OpenMPT-1.29/include/mpg123/src/compat/compat.h Modified: branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt Sat Jun 7 21:54:44 2025 (r23424) +++ branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt Sat Jun 7 21:55:04 2025 (r23425) @@ -3,7 +3,7 @@ * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified to + * `src/compat/compat.c` and `src/compat/compat.h` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.29/include/mpg123/ports/generic/config.h ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/ports/generic/config.h Sat Jun 7 21:54:44 2025 (r23424) +++ branches/OpenMPT-1.29/include/mpg123/ports/generic/config.h Sat Jun 7 21:55:04 2025 (r23425) @@ -99,6 +99,9 @@ /* libmpg123 does not care about file mode */ #define NO_FILEMODE +/* libmpg123 does not care about strtok */ +#define NO_STRTOK + /* We want some frame index, eh? */ #define FRAME_INDEX 1 #define INDEX_SIZE 1000 Modified: branches/OpenMPT-1.29/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/compat/compat.h Sat Jun 7 21:54:44 2025 (r23424) +++ branches/OpenMPT-1.29/include/mpg123/src/compat/compat.h Sat Jun 7 21:55:04 2025 (r23425) @@ -110,6 +110,7 @@ typedef unsigned char byte; +#ifndef NO_STRTOK /* OpenMPT */ // Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while // C11 declares another strtok_s with different prototype. Thanks to you all. #ifdef HAVE_STRTOK_R @@ -122,6 +123,7 @@ #define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) #endif #endif +#endif /* OpenMPT */ #if defined(MPG123_COMPAT_MSVCRT_IO) #if defined(_UCRT) @@ -159,10 +161,12 @@ #include <io.h> #endif +#ifndef NO_STRTOK /* OpenMPT */ #ifndef INT123_compat_strtok #warning "no safe strtok found" #define INT123_compat_strtok(a, b, c) strtok((a), (b)) #endif +#endif /* OpenMPT */ /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); |
From: <sv...@op...> - 2025-06-07 19:54:50
|
Author: manx Date: Sat Jun 7 21:54:44 2025 New Revision: 23424 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23424 Log: Merged revision(s) 23421 from trunk/OpenMPT: [Fix] mpg123: Exclude unneeded and broken strtok work-arounds. ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt branches/OpenMPT-1.30/include/mpg123/ports/generic/config.h branches/OpenMPT-1.30/include/mpg123/src/compat/compat.h Modified: branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt Sat Jun 7 21:54:25 2025 (r23423) +++ branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt Sat Jun 7 21:54:44 2025 (r23424) @@ -3,7 +3,7 @@ * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified to + * `src/compat/compat.c` and `src/compat/compat.h` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.30/include/mpg123/ports/generic/config.h ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/ports/generic/config.h Sat Jun 7 21:54:25 2025 (r23423) +++ branches/OpenMPT-1.30/include/mpg123/ports/generic/config.h Sat Jun 7 21:54:44 2025 (r23424) @@ -99,6 +99,9 @@ /* libmpg123 does not care about file mode */ #define NO_FILEMODE +/* libmpg123 does not care about strtok */ +#define NO_STRTOK + /* We want some frame index, eh? */ #define FRAME_INDEX 1 #define INDEX_SIZE 1000 Modified: branches/OpenMPT-1.30/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/compat/compat.h Sat Jun 7 21:54:25 2025 (r23423) +++ branches/OpenMPT-1.30/include/mpg123/src/compat/compat.h Sat Jun 7 21:54:44 2025 (r23424) @@ -110,6 +110,7 @@ typedef unsigned char byte; +#ifndef NO_STRTOK /* OpenMPT */ // Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while // C11 declares another strtok_s with different prototype. Thanks to you all. #ifdef HAVE_STRTOK_R @@ -122,6 +123,7 @@ #define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) #endif #endif +#endif /* OpenMPT */ #if defined(MPG123_COMPAT_MSVCRT_IO) #if defined(_UCRT) @@ -159,10 +161,12 @@ #include <io.h> #endif +#ifndef NO_STRTOK /* OpenMPT */ #ifndef INT123_compat_strtok #warning "no safe strtok found" #define INT123_compat_strtok(a, b, c) strtok((a), (b)) #endif +#endif /* OpenMPT */ /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); |
From: <sv...@op...> - 2025-06-07 19:54:37
|
Author: manx Date: Sat Jun 7 21:54:25 2025 New Revision: 23423 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23423 Log: Merged revision(s) 23421 from trunk/OpenMPT: [Fix] mpg123: Exclude unneeded and broken strtok work-arounds. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt branches/OpenMPT-1.31/include/mpg123/ports/generic/config.h branches/OpenMPT-1.31/include/mpg123/src/compat/compat.h Modified: branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt Sat Jun 7 21:54:07 2025 (r23422) +++ branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt Sat Jun 7 21:54:25 2025 (r23423) @@ -3,7 +3,7 @@ * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified to + * `src/compat/compat.c` and `src/compat/compat.h` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.31/include/mpg123/ports/generic/config.h ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/ports/generic/config.h Sat Jun 7 21:54:07 2025 (r23422) +++ branches/OpenMPT-1.31/include/mpg123/ports/generic/config.h Sat Jun 7 21:54:25 2025 (r23423) @@ -99,6 +99,9 @@ /* libmpg123 does not care about file mode */ #define NO_FILEMODE +/* libmpg123 does not care about strtok */ +#define NO_STRTOK + /* We want some frame index, eh? */ #define FRAME_INDEX 1 #define INDEX_SIZE 1000 Modified: branches/OpenMPT-1.31/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/compat/compat.h Sat Jun 7 21:54:07 2025 (r23422) +++ branches/OpenMPT-1.31/include/mpg123/src/compat/compat.h Sat Jun 7 21:54:25 2025 (r23423) @@ -110,6 +110,7 @@ typedef unsigned char byte; +#ifndef NO_STRTOK /* OpenMPT */ // Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while // C11 declares another strtok_s with different prototype. Thanks to you all. #ifdef HAVE_STRTOK_R @@ -122,6 +123,7 @@ #define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) #endif #endif +#endif /* OpenMPT */ #if defined(MPG123_COMPAT_MSVCRT_IO) #if defined(_UCRT) @@ -159,10 +161,12 @@ #include <io.h> #endif +#ifndef NO_STRTOK /* OpenMPT */ #ifndef INT123_compat_strtok #warning "no safe strtok found" #define INT123_compat_strtok(a, b, c) strtok((a), (b)) #endif +#endif /* OpenMPT */ /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); |
From: <sv...@op...> - 2025-06-07 19:54:26
|
Author: manx Date: Sat Jun 7 21:54:07 2025 New Revision: 23422 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23422 Log: Merged revision(s) 23421 from trunk/OpenMPT: [Fix] mpg123: Exclude unneeded and broken strtok work-arounds. ........ Modified: branches/OpenMPT-1.32/ (props changed) branches/OpenMPT-1.32/include/mpg123/OpenMPT.txt branches/OpenMPT-1.32/include/mpg123/ports/generic/config.h branches/OpenMPT-1.32/include/mpg123/src/compat/compat.h Modified: branches/OpenMPT-1.32/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/OpenMPT.txt Sat Jun 7 21:53:48 2025 (r23421) +++ branches/OpenMPT-1.32/include/mpg123/OpenMPT.txt Sat Jun 7 21:54:07 2025 (r23422) @@ -3,7 +3,7 @@ * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified to + * `src/compat/compat.c` and `src/compat/compat.h` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.32/include/mpg123/ports/generic/config.h ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/ports/generic/config.h Sat Jun 7 21:53:48 2025 (r23421) +++ branches/OpenMPT-1.32/include/mpg123/ports/generic/config.h Sat Jun 7 21:54:07 2025 (r23422) @@ -99,6 +99,9 @@ /* libmpg123 does not care about file mode */ #define NO_FILEMODE +/* libmpg123 does not care about strtok */ +#define NO_STRTOK + /* We want some frame index, eh? */ #define FRAME_INDEX 1 #define INDEX_SIZE 1000 Modified: branches/OpenMPT-1.32/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/src/compat/compat.h Sat Jun 7 21:53:48 2025 (r23421) +++ branches/OpenMPT-1.32/include/mpg123/src/compat/compat.h Sat Jun 7 21:54:07 2025 (r23422) @@ -110,6 +110,7 @@ typedef unsigned char byte; +#ifndef NO_STRTOK /* OpenMPT */ // Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while // C11 declares another strtok_s with different prototype. Thanks to you all. #ifdef HAVE_STRTOK_R @@ -122,6 +123,7 @@ #define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) #endif #endif +#endif /* OpenMPT */ #if defined(MPG123_COMPAT_MSVCRT_IO) #if defined(_UCRT) @@ -159,10 +161,12 @@ #include <io.h> #endif +#ifndef NO_STRTOK /* OpenMPT */ #ifndef INT123_compat_strtok #warning "no safe strtok found" #define INT123_compat_strtok(a, b, c) strtok((a), (b)) #endif +#endif /* OpenMPT */ /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); |
From: <sv...@op...> - 2025-06-07 19:54:00
|
Author: manx Date: Sat Jun 7 21:53:48 2025 New Revision: 23421 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23421 Log: [Fix] mpg123: Exclude unneeded and broken strtok work-arounds. Modified: trunk/OpenMPT/include/mpg123/OpenMPT.txt trunk/OpenMPT/include/mpg123/ports/generic/config.h trunk/OpenMPT/include/mpg123/src/compat/compat.h Modified: trunk/OpenMPT/include/mpg123/OpenMPT.txt ============================================================================== --- trunk/OpenMPT/include/mpg123/OpenMPT.txt Sat Jun 7 20:09:38 2025 (r23420) +++ trunk/OpenMPT/include/mpg123/OpenMPT.txt Sat Jun 7 21:53:48 2025 (r23421) @@ -3,7 +3,7 @@ * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified to + * `src/compat/compat.c` and `src/compat/compat.h` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: trunk/OpenMPT/include/mpg123/ports/generic/config.h ============================================================================== --- trunk/OpenMPT/include/mpg123/ports/generic/config.h Sat Jun 7 20:09:38 2025 (r23420) +++ trunk/OpenMPT/include/mpg123/ports/generic/config.h Sat Jun 7 21:53:48 2025 (r23421) @@ -99,6 +99,9 @@ /* libmpg123 does not care about file mode */ #define NO_FILEMODE +/* libmpg123 does not care about strtok */ +#define NO_STRTOK + /* We want some frame index, eh? */ #define FRAME_INDEX 1 #define INDEX_SIZE 1000 Modified: trunk/OpenMPT/include/mpg123/src/compat/compat.h ============================================================================== --- trunk/OpenMPT/include/mpg123/src/compat/compat.h Sat Jun 7 20:09:38 2025 (r23420) +++ trunk/OpenMPT/include/mpg123/src/compat/compat.h Sat Jun 7 21:53:48 2025 (r23421) @@ -110,6 +110,7 @@ typedef unsigned char byte; +#ifndef NO_STRTOK /* OpenMPT */ // Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while // C11 declares another strtok_s with different prototype. Thanks to you all. #ifdef HAVE_STRTOK_R @@ -122,6 +123,7 @@ #define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) #endif #endif +#endif /* OpenMPT */ #if defined(MPG123_COMPAT_MSVCRT_IO) #if defined(_UCRT) @@ -159,10 +161,12 @@ #include <io.h> #endif +#ifndef NO_STRTOK /* OpenMPT */ #ifndef INT123_compat_strtok #warning "no safe strtok found" #define INT123_compat_strtok(a, b, c) strtok((a), (b)) #endif +#endif /* OpenMPT */ /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); |
From: <sv...@op...> - 2025-06-07 18:09:50
|
Author: manx Date: Sat Jun 7 20:09:38 2025 New Revision: 23420 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23420 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Modified: branches/OpenMPT-1.28/libopenmpt/dox/changelog.md ============================================================================== --- branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Sat Jun 7 20:09:34 2025 (r23419) +++ branches/OpenMPT-1.28/libopenmpt/dox/changelog.md Sat Jun 7 20:09:38 2025 (r23420) @@ -11,6 +11,8 @@ `openmpt_get_string("source_has_mixed_revisions")` always returned an empty string. + * mpg123: Update to v1.33.0 (2025-06-07). + ### libopenmpt 0.4.48 (2025-01-06) * The internal LFO plugin could misbehave in Tempo Sync mode when rows per |
From: <sv...@op...> - 2025-06-07 18:09:45
|
Author: manx Date: Sat Jun 7 20:09:34 2025 New Revision: 23419 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23419 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Modified: branches/OpenMPT-1.29/libopenmpt/dox/changelog.md ============================================================================== --- branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Sat Jun 7 20:09:30 2025 (r23418) +++ branches/OpenMPT-1.29/libopenmpt/dox/changelog.md Sat Jun 7 20:09:34 2025 (r23419) @@ -11,6 +11,8 @@ `openmpt_get_string("source_has_mixed_revisions")` always returned an empty string. + * mpg123: Update to v1.33.0 (2025-06-07). + * miniz: Update to v3.0.2 (2023-01-15). * pugixml: Update to v1.15 (2025-01-10). ### libopenmpt 0.5.36 (2025-01-06) |
From: <sv...@op...> - 2025-06-07 18:09:37
|
Author: manx Date: Sat Jun 7 20:09:26 2025 New Revision: 23417 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23417 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Modified: branches/OpenMPT-1.31/doc/libopenmpt/changelog.md ============================================================================== --- branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Sat Jun 7 20:09:18 2025 (r23416) +++ branches/OpenMPT-1.31/doc/libopenmpt/changelog.md Sat Jun 7 20:09:26 2025 (r23417) @@ -13,7 +13,8 @@ * [**Bug**] Work-around broken user locale support on Haiku by always assuming UTF8. - * miniz: v3.0.2 (2023-01-15). + * mpg123: Update to v1.33.0 (2025-06-07). + * miniz: Update to v3.0.2 (2023-01-15). * pugixml: Update to v1.15 (2025-01-10). ### libopenmpt 0.7.13 (2025-01-06) |
From: <sv...@op...> - 2025-06-07 18:09:36
|
Author: manx Date: Sat Jun 7 20:09:30 2025 New Revision: 23418 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23418 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Modified: branches/OpenMPT-1.30/libopenmpt/dox/changelog.md ============================================================================== --- branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Sat Jun 7 20:09:26 2025 (r23417) +++ branches/OpenMPT-1.30/libopenmpt/dox/changelog.md Sat Jun 7 20:09:30 2025 (r23418) @@ -13,7 +13,8 @@ * [**Bug**] Work-around broken user locale support on Haiku by always assuming UTF8. - * miniz: v3.0.2 (2023-01-15). + * mpg123: Update to v1.33.0 (2025-06-07). + * miniz: Update to v3.0.2 (2023-01-15). * pugixml: Update to v1.15 (2025-01-10). ### libopenmpt 0.6.22 (2025-01-06) |
From: <sv...@op...> - 2025-06-07 18:09:25
|
Author: manx Date: Sat Jun 7 20:09:18 2025 New Revision: 23416 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23416 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.32/doc/libopenmpt/changelog.md Modified: branches/OpenMPT-1.32/doc/libopenmpt/changelog.md ============================================================================== --- branches/OpenMPT-1.32/doc/libopenmpt/changelog.md Sat Jun 7 20:07:14 2025 (r23415) +++ branches/OpenMPT-1.32/doc/libopenmpt/changelog.md Sat Jun 7 20:09:18 2025 (r23416) @@ -17,7 +17,8 @@ * Building with libmpg123 1.33.0 in PORTABLE_API mode now works. - * miniz: v3.0.2 (2023-01-15). + * mpg123: Update to v1.33.0 (2025-06-07). + * miniz: Update to v3.0.2 (2023-01-15). ### libopenmpt 0.8.0 (2025-05-31) |
Author: manx Date: Sat Jun 7 20:07:14 2025 New Revision: 23415 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23415 Log: Merged revision(s) 23410 from trunk/OpenMPT: [Var] mpg123: Update to 1.33.0 (2025-06-07). ........ Modified: branches/OpenMPT-1.28/ (props changed) branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt branches/OpenMPT-1.28/include/mpg123/src/compat/compat.c branches/OpenMPT-1.28/include/mpg123/src/compat/compat.h branches/OpenMPT-1.28/include/mpg123/src/include/mpg123.h branches/OpenMPT-1.28/include/mpg123/src/include/out123.h branches/OpenMPT-1.28/include/mpg123/src/include/syn123.h branches/OpenMPT-1.28/include/mpg123/src/libmpg123/layer2.c branches/OpenMPT-1.28/include/mpg123/src/libmpg123/libmpg123.c branches/OpenMPT-1.28/include/mpg123/src/version.h Modified: branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt Sat Jun 7 20:06:53 2025 (r23414) +++ branches/OpenMPT-1.28/include/mpg123/OpenMPT.txt Sat Jun 7 20:07:14 2025 (r23415) @@ -1,9 +1,9 @@ -libmpg123 library version 1.32.10 (2024-12-14). +libmpg123 library version 1.33.0 (2025-06-07). The following changes have been made: * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified for to + * `src/compat/compat.c` and `src/compat/compat.c` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.28/include/mpg123/src/compat/compat.c ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/compat/compat.c Sat Jun 7 20:06:53 2025 (r23414) +++ branches/OpenMPT-1.28/include/mpg123/src/compat/compat.c Sat Jun 7 20:07:14 2025 (r23415) @@ -530,7 +530,7 @@ } #ifndef NO_CATCHSIGNAL -#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) +#if (!defined(WIN32) || defined (__CYGWIN__)) && !defined(__PSP__) && defined(HAVE_SIGNAL_H) void (*INT123_catchsignal(int signum, void(*handler)(int)))(int) { struct sigaction new_sa; Modified: branches/OpenMPT-1.28/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/compat/compat.h Sat Jun 7 20:06:53 2025 (r23414) +++ branches/OpenMPT-1.28/include/mpg123/src/compat/compat.h Sat Jun 7 20:07:14 2025 (r23415) @@ -110,8 +110,17 @@ typedef unsigned char byte; +// Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while +// C11 declares another strtok_s with different prototype. Thanks to you all. +#ifdef HAVE_STRTOK_R +#define INT123_compat_strtok(a, b, c) strtok_r((a), (b), (c)) +#endif + #if (defined(_UCRT) || defined(_MSC_VER) || (defined(__MINGW32__) || defined(__MINGW64__)) || (defined(__WATCOMC__) && defined(__NT__))) && !defined(__CYGWIN__) #define MPG123_COMPAT_MSVCRT_IO +#ifndef INT123_compat_strtok +#define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) +#endif #endif #if defined(MPG123_COMPAT_MSVCRT_IO) @@ -150,6 +159,11 @@ #include <io.h> #endif +#ifndef INT123_compat_strtok +#warning "no safe strtok found" +#define INT123_compat_strtok(a, b, c) strtok((a), (b)) +#endif + /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); // Also freeing ptr if result is NULL. You can do Modified: branches/OpenMPT-1.28/include/mpg123/src/include/mpg123.h ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/include/mpg123.h Sat Jun 7 20:06:53 2025 (r23414) +++ branches/OpenMPT-1.28/include/mpg123/src/include/mpg123.h Sat Jun 7 20:07:14 2025 (r23415) @@ -13,11 +13,15 @@ /** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ +/** \defgroup mpg123_h mpg123 header general settings and notes + * @{ + */ + /** A macro to check at compile time which set of API functions to expect. * This must be incremented at least each time a new symbol is added * to the header. */ -#define MPG123_API_VERSION 48 +#define MPG123_API_VERSION 49 /** library patch level at client build time */ #define MPG123_PATCHLEVEL 3 @@ -43,8 +47,10 @@ #endif #endif -/** Earlier versions of libmpg123 put enums into public API calls, - * thich is not exactly safe. There are ABI rules, but you can use +/** \page enumapi About enum API + * + * Earlier versions of libmpg123 put enums into public API calls, + * which is not exactly safe. There are ABI rules, but you can use * compiler switches to change the sizes of enums. It is safer not * to have them in API calls. Thus, the default is to remap calls and * structs to variants that use plain ints. Define MPG123_ENUM_API to @@ -53,6 +59,21 @@ * You might want to define this to increase the chance of your binary * working with an older version of the library. But if that is your goal, * you should better build with an older version to begin with. + * + * You can avoid renamed symbols by using the non-enum names directly: + * + * - mpg123_param2() + * - mpg123_getparam2() + * - mpg123_feature2() + * - mpg123_eq2() + * - mpg123_geteq2() + * - mpg123_frameinfo2() + * - mpg123_info2() + * - mpg123_getstate2() + * - mpg123_enc_from_id3_2() + * - mpg123_store_utf8_2() + * - mpg123_par2() + * - mpg123_getpar2() */ #ifndef MPG123_ENUM_API @@ -76,7 +97,7 @@ #ifndef MPG123_PORTABLE_API #include <sys/types.h> -/* A little hack to help MSVC not having ssize_t. */ +/** A little hack to help MSVC not having ssize_t. */ #ifdef _MSC_VER typedef ptrdiff_t mpg123_ssize_t; #else @@ -85,26 +106,61 @@ #endif -/* Handling of large file offsets. - When client code defines _FILE_OFFSET_BITS, it wants non-default large file support, - and thus functions with added suffix (mpg123_open_64). The default library build provides - wrapper and alias functions to accomodate client code variations (dual-mode library like glibc). - - Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling - or enforcing the suffixes. If explicit usage of 64 bit offsets is desired, the int64_t API - (functions with 64 suffix without underscore, notablly mpg123_reader64()) can be used since - API version 48 (mpg123 1.32). - - When in doubt, use the explicit 64 bit functions and avoid off_t in the API. You can define - MPG123_PORTABLE_API to ensure that. That being said, if you and your compiler do not have - problems with the concept of off_t, just use the normal API and be happy. Both 32 and 64 - bit versions will be present where appropriate. -*/ +/** \page lfs Handling of large file offsets + * + * When client code defines _FILE_OFFSET_BITS, it wants non-default large file + * support, and thus functions with added suffix (mpg123_open_64). The default + * library build provides wrapper and alias functions to accomodate client code + * variations (dual-mode library like glibc). + * + * Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, + * respectively, for disabling or enforcing the suffixes. You should *not* do + * this, though, unless you *really* want to deal with symbol ABI yourself. + * If explicit usage of 64 bit offsets is desired, the int64_t API + * consisting of functions with 64 suffix without underscore, notably + * mpg123_reader64(), can be used since API version 48 (mpg123 1.32). A matching + * mpg123_open64(), stripped-down mpg123_open_handle_64() is present since API + * version 49 (mpg123 1.33). + * + * When in doubt, use the explicit 64 bit functions and avoid off_t in the API. + * You can define MPG123_PORTABLE_API to ensure that. That being said, if you + * and your compiler do not have problems with the concept of off_t, just use + * the normal AP like the I/O API of the standard C library. Both 32 and 64 bit + * versions of functions will be present where appropriate. + * + * If your toolchain enforces _FILE_OFFSET_BITS also during build of libmpg123, + * only that setting will be supported for client code. + */ #ifndef MPG123_PORTABLE_API -/* - Now, the renaming of large file aware functions. - By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +/** \page lfs_names Renaming of functions for largefile support + * + * Now, the renaming of large file aware functions. + * By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64() for mpg123_seek()), + * if _FILE_OFFSET_BITS is defined. These are the affected API functions: + * + * - mpg123_open_fixed() + * - mpg123_open() + * - mpg123_open_fd() + * - mpg123_open_handle() + * - mpg123_framebyframe_decode() + * - mpg123_decode_frame() + * - mpg123_tell() + * - mpg123_tellframe() + * - mpg123_tell_stream() + * - mpg123_seek() + * - mpg123_feedseek() + * - mpg123_seek_frame() + * - mpg123_timeframe() + * - mpg123_index() + * - mpg123_set_index() + * - mpg123_position() + * - mpg123_length() + * - mpg123_framelength() + * - mpg123_set_filesize() + * - mpg123_replace_reader() + * - mpg123_replace_reader_handle() + * - mpg123_framepos() */ #if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) @@ -142,6 +198,8 @@ #endif /* largefile hackery */ #endif +/** @} */ + #ifdef __cplusplus extern "C" { #endif @@ -774,7 +832,7 @@ * UTF-8, which also fits any sane modern install of Unix-like systems. * * \param mh handle - * \param path filesystem + * \param path filesystem path * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path); @@ -786,17 +844,63 @@ * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); -#endif /** Use an opaque handle as bitstream input. This works only with the * replaced I/O from mpg123_replace_reader_handle() or mpg123_reader64()! * mpg123_close() will call the cleanup callback for your non-NULL * handle (if you gave one). + * Note that this used to be usable with MPG123_PORTABLE_API defined in + * mpg123 1.32.x and was in fact the only entry point for handle I/O. + * Since mpg123 1.33.0 and API version 49, there is + * mpg123_open_handle64() for the portable case and has to be used + * instead of this function here, even if it _would_ work just fine, + * the inclusion of a largefile-renamed symbol in the portable set was wrong. + * * \param mh handle * \param iohandle your handle * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); +#endif + +/** Open and prepare to decode the specified file by filesystem path. + * This works exactly like mpg123_open() in modern libmpg123, see there + * for more description. This name is not subject to largefile symbol renaming. + * You can also use it with MPG123_PORTABLE_API. + * + * \param mh handle + * \param path filesystem path of your resource + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open64(mpg123_handle *mh, const char *path); + +/** Open a simple MPEG file with fixed properties. + * This is the same as mpg123_open_fixed(), just with a stable + * symbol name for int64_t portable API. + * + * \param mh handle + * \param path filesystem path (see mpg123_open()) + * \param channels allowed channel count, either 1 (MPG123_MONO) or + * 2 (MPG123_STEREO), or bitwise or of them, but then you're halfway back to + * calling mpg123_format() again;-) + * \param encoding a definite encoding from enum mpg123_enc_enum + * or a bitmask like for mpg123_format(), defeating the purpose somewhat + */ +MPG123_EXPORT int mpg123_open_fixed64(mpg123_handle *mh, const char *path +, int channels, int encoding); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_reader64()! + * mpg123_close() will call the cleanup callback for your non-NULL + * handle (if you gave one). + * This is a simplified variant of mpg123_open_handle() that only + * supports the int64_t API, available with MPG123_PORTABLE_API. + * + * \param mh handle + * \param iohandle your handle + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open_handle64(mpg123_handle *mh, void *iohandle); /** Open a new bitstream and prepare for direct feeding * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. @@ -1258,6 +1362,7 @@ /** Set a range of equalizer bands * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. + * \param mh handle * \param a The first equalizer band to set (from 0 to 31) * \param b The last equalizer band to set (from 0 to 31) * \param factor The (linear) adjustment factor, 1 being neutral. @@ -1267,6 +1372,7 @@ , int channel, int a, int b, double factor ); /** Change a range of equalizer bands + * \param mh handle * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. * \param a The first equalizer band to change (from 0 to 31) @@ -2218,7 +2324,8 @@ /** Set up portable read functions on an opaque handle. * The handle is a void pointer, so you can pass any data you want... - * mpg123_open_handle() is the call you make to use the I/O defined here. + * mpg123_open64() (since API 49) or mpg123_open_handle() is the call you make + * to use the I/O defined here. * There is no fallback to internal read/seek here. * Note: As it would be troublesome to mess with this while having a file open, * this mpg123_close() is implied here. Modified: branches/OpenMPT-1.28/include/mpg123/src/include/out123.h ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/include/out123.h Sat Jun 7 20:06:53 2025 (r23414) +++ branches/OpenMPT-1.28/include/mpg123/src/include/out123.h Sat Jun 7 20:07:14 2025 (r23415) @@ -20,7 +20,7 @@ */ #define OUT123_API_VERSION 5 /** library patch level at client build time */ -#define OUT123_PATCHLEVEL 1 +#define OUT123_PATCHLEVEL 2 /* We only need size_t definition. */ #include <stddef.h> Modified: branches/OpenMPT-1.28/include/mpg123/src/include/syn123.h ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/include/syn123.h Sat Jun 7 20:06:53 2025 (r23414) +++ branches/OpenMPT-1.28/include/mpg123/src/include/syn123.h Sat Jun 7 20:07:14 2025 (r23415) @@ -1112,7 +1112,7 @@ // anywhere, also to avoid using non-standard types like ssize_t. #if !defined(SYN123_PORTABLE_API) && !defined(SYN123_NO_LARGEFUNC) -/* A little hack to help MSVC not having ssize_t, duplicated in internal header. */ +/** A little hack to help MSVC not having ssize_t, duplicated in internal header. */ #ifdef _MSC_VER #include <stddef.h> typedef ptrdiff_t syn123_ssize_t; Modified: branches/OpenMPT-1.28/include/mpg123/src/libmpg123/layer2.c ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:06:53 2025 (r23414) +++ branches/OpenMPT-1.28/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:07:14 2025 (r23415) @@ -341,7 +341,8 @@ if(fr->jsbound > fr->II_sblimit) { - fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); + if(NOQUIET) + error("Truncating stereo boundary to sideband limit."); fr->jsbound=fr->II_sblimit; } Modified: branches/OpenMPT-1.28/include/mpg123/src/libmpg123/libmpg123.c ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:06:53 2025 (r23414) +++ branches/OpenMPT-1.28/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:07:14 2025 (r23415) @@ -15,9 +15,7 @@ #define FORCE_ACCURATE #include "../common/sample.h" #include "parse.h" -#ifndef PORTABLE_API #include "lfs_wrap.h" -#endif #include "../common/debug.h" @@ -559,18 +557,9 @@ return mpg123_geteq(mh, channel, band); } -#ifndef PORTABLE_API - -#ifdef FORCED_OFF_64 -// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. -#define mpg123_open mpg123_open_64 -#define mpg123_open_fixed mpg123_open_fixed_64 -#define mpg123_open_fd mpg123_open_fd_64 -#define mpg123_open_handle mpg123_open_handle_64 -#endif - -/* plain file access, no http! */ -int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +// LFS wrapper code is so agnostic to it all now that internal I/O is portable +// as long as you do not mix in off_t API. +int attribute_align_arg mpg123_open64(mpg123_handle *mh, const char *path) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -585,6 +574,24 @@ return ret; } +#ifndef PORTABLE_API + +#ifdef FORCED_OFF_64 +// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. +#define mpg123_open mpg123_open_64 +#define mpg123_open_fixed mpg123_open_fixed_64 +#define mpg123_open_fd mpg123_open_fd_64 +#define mpg123_open_handle mpg123_open_handle_64 +#endif + +// This now is agnostic to off_t choice, but still subject to renaming +// for legacy reasons. +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + return mpg123_open64(mh, path); +} +#endif // PORTABLE_API + // The convenience function mpg123_open_fixed() wraps over acual mpg123_open // and hence needs to have the exact same code in lfs_wrap.c. The flesh is // in INT123_open_fixed_pre() and INT123_open_fixed_post(), wich are only defined here. @@ -624,17 +631,28 @@ return err; } -int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +int attribute_align_arg mpg123_open_fixed64( mpg123_handle *mh, const char *path , int channels, int encoding ) { int err = INT123_open_fixed_pre(mh, channels, encoding); if(err == MPG123_OK) - err = mpg123_open(mh, path); + err = mpg123_open64(mh, path); if(err == MPG123_OK) err = INT123_open_fixed_post(mh, channels, encoding); return err; } +#ifndef PORTABLE_API +// Only to have the modern offset-agnostic open under a fixed name. +int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +, int channels, int encoding ) +{ + return mpg123_open_fixed64(mh, path, channels, encoding); +} + +// Won't define a 'portable' variant of this, as I cannot guess +// properties of the handed-in fd, which in theory, on specific platforms, +// could not support large files. int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -650,21 +668,33 @@ } #endif // PORTABLE_API +// Only works with int64 reader setup. +int attribute_align_arg mpg123_open_handle64(mpg123_handle *mh, void *iohandle) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + return INT123_open_stream_handle(mh, iohandle); +} + +#ifndef PORTABLE_API +// Change from 1.32: No largefile-renamed symbols in a library with strict +// portable API. +// I allow that breaking change since this is far from a standard libmpg123 build. int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle) { if(mh == NULL) return MPG123_BAD_HANDLE; mpg123_close(mh); int ret; -#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, iohandle); return ret; } +#endif int attribute_align_arg mpg123_open_feed(mpg123_handle *mh) { Modified: branches/OpenMPT-1.28/include/mpg123/src/version.h ============================================================================== --- branches/OpenMPT-1.28/include/mpg123/src/version.h Sat Jun 7 20:06:53 2025 (r23414) +++ branches/OpenMPT-1.28/include/mpg123/src/version.h Sat Jun 7 20:07:14 2025 (r23415) @@ -15,8 +15,8 @@ // only single spaces as separator to ease parsing by build scripts #define MPG123_MAJOR 1 -#define MPG123_MINOR 32 -#define MPG123_PATCH 10 +#define MPG123_MINOR 33 +#define MPG123_PATCH 0 // 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 "" |
Author: manx Date: Sat Jun 7 20:06:53 2025 New Revision: 23414 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23414 Log: Merged revision(s) 23410 from trunk/OpenMPT: [Var] mpg123: Update to 1.33.0 (2025-06-07). ........ Modified: branches/OpenMPT-1.29/ (props changed) branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt branches/OpenMPT-1.29/include/mpg123/src/compat/compat.c branches/OpenMPT-1.29/include/mpg123/src/compat/compat.h branches/OpenMPT-1.29/include/mpg123/src/include/mpg123.h branches/OpenMPT-1.29/include/mpg123/src/include/out123.h branches/OpenMPT-1.29/include/mpg123/src/include/syn123.h branches/OpenMPT-1.29/include/mpg123/src/libmpg123/layer2.c branches/OpenMPT-1.29/include/mpg123/src/libmpg123/libmpg123.c branches/OpenMPT-1.29/include/mpg123/src/version.h Modified: branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt Sat Jun 7 20:06:31 2025 (r23413) +++ branches/OpenMPT-1.29/include/mpg123/OpenMPT.txt Sat Jun 7 20:06:53 2025 (r23414) @@ -1,9 +1,9 @@ -libmpg123 library version 1.32.10 (2024-12-14). +libmpg123 library version 1.33.0 (2025-06-07). The following changes have been made: * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified for to + * `src/compat/compat.c` and `src/compat/compat.c` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.29/include/mpg123/src/compat/compat.c ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/compat/compat.c Sat Jun 7 20:06:31 2025 (r23413) +++ branches/OpenMPT-1.29/include/mpg123/src/compat/compat.c Sat Jun 7 20:06:53 2025 (r23414) @@ -530,7 +530,7 @@ } #ifndef NO_CATCHSIGNAL -#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) +#if (!defined(WIN32) || defined (__CYGWIN__)) && !defined(__PSP__) && defined(HAVE_SIGNAL_H) void (*INT123_catchsignal(int signum, void(*handler)(int)))(int) { struct sigaction new_sa; Modified: branches/OpenMPT-1.29/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/compat/compat.h Sat Jun 7 20:06:31 2025 (r23413) +++ branches/OpenMPT-1.29/include/mpg123/src/compat/compat.h Sat Jun 7 20:06:53 2025 (r23414) @@ -110,8 +110,17 @@ typedef unsigned char byte; +// Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while +// C11 declares another strtok_s with different prototype. Thanks to you all. +#ifdef HAVE_STRTOK_R +#define INT123_compat_strtok(a, b, c) strtok_r((a), (b), (c)) +#endif + #if (defined(_UCRT) || defined(_MSC_VER) || (defined(__MINGW32__) || defined(__MINGW64__)) || (defined(__WATCOMC__) && defined(__NT__))) && !defined(__CYGWIN__) #define MPG123_COMPAT_MSVCRT_IO +#ifndef INT123_compat_strtok +#define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) +#endif #endif #if defined(MPG123_COMPAT_MSVCRT_IO) @@ -150,6 +159,11 @@ #include <io.h> #endif +#ifndef INT123_compat_strtok +#warning "no safe strtok found" +#define INT123_compat_strtok(a, b, c) strtok((a), (b)) +#endif + /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); // Also freeing ptr if result is NULL. You can do Modified: branches/OpenMPT-1.29/include/mpg123/src/include/mpg123.h ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/include/mpg123.h Sat Jun 7 20:06:31 2025 (r23413) +++ branches/OpenMPT-1.29/include/mpg123/src/include/mpg123.h Sat Jun 7 20:06:53 2025 (r23414) @@ -13,11 +13,15 @@ /** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ +/** \defgroup mpg123_h mpg123 header general settings and notes + * @{ + */ + /** A macro to check at compile time which set of API functions to expect. * This must be incremented at least each time a new symbol is added * to the header. */ -#define MPG123_API_VERSION 48 +#define MPG123_API_VERSION 49 /** library patch level at client build time */ #define MPG123_PATCHLEVEL 3 @@ -43,8 +47,10 @@ #endif #endif -/** Earlier versions of libmpg123 put enums into public API calls, - * thich is not exactly safe. There are ABI rules, but you can use +/** \page enumapi About enum API + * + * Earlier versions of libmpg123 put enums into public API calls, + * which is not exactly safe. There are ABI rules, but you can use * compiler switches to change the sizes of enums. It is safer not * to have them in API calls. Thus, the default is to remap calls and * structs to variants that use plain ints. Define MPG123_ENUM_API to @@ -53,6 +59,21 @@ * You might want to define this to increase the chance of your binary * working with an older version of the library. But if that is your goal, * you should better build with an older version to begin with. + * + * You can avoid renamed symbols by using the non-enum names directly: + * + * - mpg123_param2() + * - mpg123_getparam2() + * - mpg123_feature2() + * - mpg123_eq2() + * - mpg123_geteq2() + * - mpg123_frameinfo2() + * - mpg123_info2() + * - mpg123_getstate2() + * - mpg123_enc_from_id3_2() + * - mpg123_store_utf8_2() + * - mpg123_par2() + * - mpg123_getpar2() */ #ifndef MPG123_ENUM_API @@ -76,7 +97,7 @@ #ifndef MPG123_PORTABLE_API #include <sys/types.h> -/* A little hack to help MSVC not having ssize_t. */ +/** A little hack to help MSVC not having ssize_t. */ #ifdef _MSC_VER typedef ptrdiff_t mpg123_ssize_t; #else @@ -85,26 +106,61 @@ #endif -/* Handling of large file offsets. - When client code defines _FILE_OFFSET_BITS, it wants non-default large file support, - and thus functions with added suffix (mpg123_open_64). The default library build provides - wrapper and alias functions to accomodate client code variations (dual-mode library like glibc). - - Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling - or enforcing the suffixes. If explicit usage of 64 bit offsets is desired, the int64_t API - (functions with 64 suffix without underscore, notablly mpg123_reader64()) can be used since - API version 48 (mpg123 1.32). - - When in doubt, use the explicit 64 bit functions and avoid off_t in the API. You can define - MPG123_PORTABLE_API to ensure that. That being said, if you and your compiler do not have - problems with the concept of off_t, just use the normal API and be happy. Both 32 and 64 - bit versions will be present where appropriate. -*/ +/** \page lfs Handling of large file offsets + * + * When client code defines _FILE_OFFSET_BITS, it wants non-default large file + * support, and thus functions with added suffix (mpg123_open_64). The default + * library build provides wrapper and alias functions to accomodate client code + * variations (dual-mode library like glibc). + * + * Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, + * respectively, for disabling or enforcing the suffixes. You should *not* do + * this, though, unless you *really* want to deal with symbol ABI yourself. + * If explicit usage of 64 bit offsets is desired, the int64_t API + * consisting of functions with 64 suffix without underscore, notably + * mpg123_reader64(), can be used since API version 48 (mpg123 1.32). A matching + * mpg123_open64(), stripped-down mpg123_open_handle_64() is present since API + * version 49 (mpg123 1.33). + * + * When in doubt, use the explicit 64 bit functions and avoid off_t in the API. + * You can define MPG123_PORTABLE_API to ensure that. That being said, if you + * and your compiler do not have problems with the concept of off_t, just use + * the normal AP like the I/O API of the standard C library. Both 32 and 64 bit + * versions of functions will be present where appropriate. + * + * If your toolchain enforces _FILE_OFFSET_BITS also during build of libmpg123, + * only that setting will be supported for client code. + */ #ifndef MPG123_PORTABLE_API -/* - Now, the renaming of large file aware functions. - By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +/** \page lfs_names Renaming of functions for largefile support + * + * Now, the renaming of large file aware functions. + * By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64() for mpg123_seek()), + * if _FILE_OFFSET_BITS is defined. These are the affected API functions: + * + * - mpg123_open_fixed() + * - mpg123_open() + * - mpg123_open_fd() + * - mpg123_open_handle() + * - mpg123_framebyframe_decode() + * - mpg123_decode_frame() + * - mpg123_tell() + * - mpg123_tellframe() + * - mpg123_tell_stream() + * - mpg123_seek() + * - mpg123_feedseek() + * - mpg123_seek_frame() + * - mpg123_timeframe() + * - mpg123_index() + * - mpg123_set_index() + * - mpg123_position() + * - mpg123_length() + * - mpg123_framelength() + * - mpg123_set_filesize() + * - mpg123_replace_reader() + * - mpg123_replace_reader_handle() + * - mpg123_framepos() */ #if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) @@ -142,6 +198,8 @@ #endif /* largefile hackery */ #endif +/** @} */ + #ifdef __cplusplus extern "C" { #endif @@ -774,7 +832,7 @@ * UTF-8, which also fits any sane modern install of Unix-like systems. * * \param mh handle - * \param path filesystem + * \param path filesystem path * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path); @@ -786,17 +844,63 @@ * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); -#endif /** Use an opaque handle as bitstream input. This works only with the * replaced I/O from mpg123_replace_reader_handle() or mpg123_reader64()! * mpg123_close() will call the cleanup callback for your non-NULL * handle (if you gave one). + * Note that this used to be usable with MPG123_PORTABLE_API defined in + * mpg123 1.32.x and was in fact the only entry point for handle I/O. + * Since mpg123 1.33.0 and API version 49, there is + * mpg123_open_handle64() for the portable case and has to be used + * instead of this function here, even if it _would_ work just fine, + * the inclusion of a largefile-renamed symbol in the portable set was wrong. + * * \param mh handle * \param iohandle your handle * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); +#endif + +/** Open and prepare to decode the specified file by filesystem path. + * This works exactly like mpg123_open() in modern libmpg123, see there + * for more description. This name is not subject to largefile symbol renaming. + * You can also use it with MPG123_PORTABLE_API. + * + * \param mh handle + * \param path filesystem path of your resource + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open64(mpg123_handle *mh, const char *path); + +/** Open a simple MPEG file with fixed properties. + * This is the same as mpg123_open_fixed(), just with a stable + * symbol name for int64_t portable API. + * + * \param mh handle + * \param path filesystem path (see mpg123_open()) + * \param channels allowed channel count, either 1 (MPG123_MONO) or + * 2 (MPG123_STEREO), or bitwise or of them, but then you're halfway back to + * calling mpg123_format() again;-) + * \param encoding a definite encoding from enum mpg123_enc_enum + * or a bitmask like for mpg123_format(), defeating the purpose somewhat + */ +MPG123_EXPORT int mpg123_open_fixed64(mpg123_handle *mh, const char *path +, int channels, int encoding); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_reader64()! + * mpg123_close() will call the cleanup callback for your non-NULL + * handle (if you gave one). + * This is a simplified variant of mpg123_open_handle() that only + * supports the int64_t API, available with MPG123_PORTABLE_API. + * + * \param mh handle + * \param iohandle your handle + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open_handle64(mpg123_handle *mh, void *iohandle); /** Open a new bitstream and prepare for direct feeding * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. @@ -1258,6 +1362,7 @@ /** Set a range of equalizer bands * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. + * \param mh handle * \param a The first equalizer band to set (from 0 to 31) * \param b The last equalizer band to set (from 0 to 31) * \param factor The (linear) adjustment factor, 1 being neutral. @@ -1267,6 +1372,7 @@ , int channel, int a, int b, double factor ); /** Change a range of equalizer bands + * \param mh handle * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. * \param a The first equalizer band to change (from 0 to 31) @@ -2218,7 +2324,8 @@ /** Set up portable read functions on an opaque handle. * The handle is a void pointer, so you can pass any data you want... - * mpg123_open_handle() is the call you make to use the I/O defined here. + * mpg123_open64() (since API 49) or mpg123_open_handle() is the call you make + * to use the I/O defined here. * There is no fallback to internal read/seek here. * Note: As it would be troublesome to mess with this while having a file open, * this mpg123_close() is implied here. Modified: branches/OpenMPT-1.29/include/mpg123/src/include/out123.h ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/include/out123.h Sat Jun 7 20:06:31 2025 (r23413) +++ branches/OpenMPT-1.29/include/mpg123/src/include/out123.h Sat Jun 7 20:06:53 2025 (r23414) @@ -20,7 +20,7 @@ */ #define OUT123_API_VERSION 5 /** library patch level at client build time */ -#define OUT123_PATCHLEVEL 1 +#define OUT123_PATCHLEVEL 2 /* We only need size_t definition. */ #include <stddef.h> Modified: branches/OpenMPT-1.29/include/mpg123/src/include/syn123.h ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/include/syn123.h Sat Jun 7 20:06:31 2025 (r23413) +++ branches/OpenMPT-1.29/include/mpg123/src/include/syn123.h Sat Jun 7 20:06:53 2025 (r23414) @@ -1112,7 +1112,7 @@ // anywhere, also to avoid using non-standard types like ssize_t. #if !defined(SYN123_PORTABLE_API) && !defined(SYN123_NO_LARGEFUNC) -/* A little hack to help MSVC not having ssize_t, duplicated in internal header. */ +/** A little hack to help MSVC not having ssize_t, duplicated in internal header. */ #ifdef _MSC_VER #include <stddef.h> typedef ptrdiff_t syn123_ssize_t; Modified: branches/OpenMPT-1.29/include/mpg123/src/libmpg123/layer2.c ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:06:31 2025 (r23413) +++ branches/OpenMPT-1.29/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:06:53 2025 (r23414) @@ -341,7 +341,8 @@ if(fr->jsbound > fr->II_sblimit) { - fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); + if(NOQUIET) + error("Truncating stereo boundary to sideband limit."); fr->jsbound=fr->II_sblimit; } Modified: branches/OpenMPT-1.29/include/mpg123/src/libmpg123/libmpg123.c ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:06:31 2025 (r23413) +++ branches/OpenMPT-1.29/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:06:53 2025 (r23414) @@ -15,9 +15,7 @@ #define FORCE_ACCURATE #include "../common/sample.h" #include "parse.h" -#ifndef PORTABLE_API #include "lfs_wrap.h" -#endif #include "../common/debug.h" @@ -559,18 +557,9 @@ return mpg123_geteq(mh, channel, band); } -#ifndef PORTABLE_API - -#ifdef FORCED_OFF_64 -// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. -#define mpg123_open mpg123_open_64 -#define mpg123_open_fixed mpg123_open_fixed_64 -#define mpg123_open_fd mpg123_open_fd_64 -#define mpg123_open_handle mpg123_open_handle_64 -#endif - -/* plain file access, no http! */ -int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +// LFS wrapper code is so agnostic to it all now that internal I/O is portable +// as long as you do not mix in off_t API. +int attribute_align_arg mpg123_open64(mpg123_handle *mh, const char *path) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -585,6 +574,24 @@ return ret; } +#ifndef PORTABLE_API + +#ifdef FORCED_OFF_64 +// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. +#define mpg123_open mpg123_open_64 +#define mpg123_open_fixed mpg123_open_fixed_64 +#define mpg123_open_fd mpg123_open_fd_64 +#define mpg123_open_handle mpg123_open_handle_64 +#endif + +// This now is agnostic to off_t choice, but still subject to renaming +// for legacy reasons. +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + return mpg123_open64(mh, path); +} +#endif // PORTABLE_API + // The convenience function mpg123_open_fixed() wraps over acual mpg123_open // and hence needs to have the exact same code in lfs_wrap.c. The flesh is // in INT123_open_fixed_pre() and INT123_open_fixed_post(), wich are only defined here. @@ -624,17 +631,28 @@ return err; } -int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +int attribute_align_arg mpg123_open_fixed64( mpg123_handle *mh, const char *path , int channels, int encoding ) { int err = INT123_open_fixed_pre(mh, channels, encoding); if(err == MPG123_OK) - err = mpg123_open(mh, path); + err = mpg123_open64(mh, path); if(err == MPG123_OK) err = INT123_open_fixed_post(mh, channels, encoding); return err; } +#ifndef PORTABLE_API +// Only to have the modern offset-agnostic open under a fixed name. +int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +, int channels, int encoding ) +{ + return mpg123_open_fixed64(mh, path, channels, encoding); +} + +// Won't define a 'portable' variant of this, as I cannot guess +// properties of the handed-in fd, which in theory, on specific platforms, +// could not support large files. int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -650,21 +668,33 @@ } #endif // PORTABLE_API +// Only works with int64 reader setup. +int attribute_align_arg mpg123_open_handle64(mpg123_handle *mh, void *iohandle) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + return INT123_open_stream_handle(mh, iohandle); +} + +#ifndef PORTABLE_API +// Change from 1.32: No largefile-renamed symbols in a library with strict +// portable API. +// I allow that breaking change since this is far from a standard libmpg123 build. int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle) { if(mh == NULL) return MPG123_BAD_HANDLE; mpg123_close(mh); int ret; -#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, iohandle); return ret; } +#endif int attribute_align_arg mpg123_open_feed(mpg123_handle *mh) { Modified: branches/OpenMPT-1.29/include/mpg123/src/version.h ============================================================================== --- branches/OpenMPT-1.29/include/mpg123/src/version.h Sat Jun 7 20:06:31 2025 (r23413) +++ branches/OpenMPT-1.29/include/mpg123/src/version.h Sat Jun 7 20:06:53 2025 (r23414) @@ -15,8 +15,8 @@ // only single spaces as separator to ease parsing by build scripts #define MPG123_MAJOR 1 -#define MPG123_MINOR 32 -#define MPG123_PATCH 10 +#define MPG123_MINOR 33 +#define MPG123_PATCH 0 // 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 "" |
Author: manx Date: Sat Jun 7 20:06:31 2025 New Revision: 23413 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23413 Log: Merged revision(s) 23410 from trunk/OpenMPT: [Var] mpg123: Update to 1.33.0 (2025-06-07). ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt branches/OpenMPT-1.30/include/mpg123/src/compat/compat.c branches/OpenMPT-1.30/include/mpg123/src/compat/compat.h branches/OpenMPT-1.30/include/mpg123/src/include/mpg123.h branches/OpenMPT-1.30/include/mpg123/src/include/out123.h branches/OpenMPT-1.30/include/mpg123/src/include/syn123.h branches/OpenMPT-1.30/include/mpg123/src/libmpg123/layer2.c branches/OpenMPT-1.30/include/mpg123/src/libmpg123/libmpg123.c branches/OpenMPT-1.30/include/mpg123/src/version.h Modified: branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt Sat Jun 7 20:06:12 2025 (r23412) +++ branches/OpenMPT-1.30/include/mpg123/OpenMPT.txt Sat Jun 7 20:06:31 2025 (r23413) @@ -1,9 +1,9 @@ -libmpg123 library version 1.32.10 (2024-12-14). +libmpg123 library version 1.33.0 (2025-06-07). The following changes have been made: * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified for to + * `src/compat/compat.c` and `src/compat/compat.c` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.30/include/mpg123/src/compat/compat.c ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/compat/compat.c Sat Jun 7 20:06:12 2025 (r23412) +++ branches/OpenMPT-1.30/include/mpg123/src/compat/compat.c Sat Jun 7 20:06:31 2025 (r23413) @@ -530,7 +530,7 @@ } #ifndef NO_CATCHSIGNAL -#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) +#if (!defined(WIN32) || defined (__CYGWIN__)) && !defined(__PSP__) && defined(HAVE_SIGNAL_H) void (*INT123_catchsignal(int signum, void(*handler)(int)))(int) { struct sigaction new_sa; Modified: branches/OpenMPT-1.30/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/compat/compat.h Sat Jun 7 20:06:12 2025 (r23412) +++ branches/OpenMPT-1.30/include/mpg123/src/compat/compat.h Sat Jun 7 20:06:31 2025 (r23413) @@ -110,8 +110,17 @@ typedef unsigned char byte; +// Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while +// C11 declares another strtok_s with different prototype. Thanks to you all. +#ifdef HAVE_STRTOK_R +#define INT123_compat_strtok(a, b, c) strtok_r((a), (b), (c)) +#endif + #if (defined(_UCRT) || defined(_MSC_VER) || (defined(__MINGW32__) || defined(__MINGW64__)) || (defined(__WATCOMC__) && defined(__NT__))) && !defined(__CYGWIN__) #define MPG123_COMPAT_MSVCRT_IO +#ifndef INT123_compat_strtok +#define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) +#endif #endif #if defined(MPG123_COMPAT_MSVCRT_IO) @@ -150,6 +159,11 @@ #include <io.h> #endif +#ifndef INT123_compat_strtok +#warning "no safe strtok found" +#define INT123_compat_strtok(a, b, c) strtok((a), (b)) +#endif + /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); // Also freeing ptr if result is NULL. You can do Modified: branches/OpenMPT-1.30/include/mpg123/src/include/mpg123.h ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/include/mpg123.h Sat Jun 7 20:06:12 2025 (r23412) +++ branches/OpenMPT-1.30/include/mpg123/src/include/mpg123.h Sat Jun 7 20:06:31 2025 (r23413) @@ -13,11 +13,15 @@ /** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ +/** \defgroup mpg123_h mpg123 header general settings and notes + * @{ + */ + /** A macro to check at compile time which set of API functions to expect. * This must be incremented at least each time a new symbol is added * to the header. */ -#define MPG123_API_VERSION 48 +#define MPG123_API_VERSION 49 /** library patch level at client build time */ #define MPG123_PATCHLEVEL 3 @@ -43,8 +47,10 @@ #endif #endif -/** Earlier versions of libmpg123 put enums into public API calls, - * thich is not exactly safe. There are ABI rules, but you can use +/** \page enumapi About enum API + * + * Earlier versions of libmpg123 put enums into public API calls, + * which is not exactly safe. There are ABI rules, but you can use * compiler switches to change the sizes of enums. It is safer not * to have them in API calls. Thus, the default is to remap calls and * structs to variants that use plain ints. Define MPG123_ENUM_API to @@ -53,6 +59,21 @@ * You might want to define this to increase the chance of your binary * working with an older version of the library. But if that is your goal, * you should better build with an older version to begin with. + * + * You can avoid renamed symbols by using the non-enum names directly: + * + * - mpg123_param2() + * - mpg123_getparam2() + * - mpg123_feature2() + * - mpg123_eq2() + * - mpg123_geteq2() + * - mpg123_frameinfo2() + * - mpg123_info2() + * - mpg123_getstate2() + * - mpg123_enc_from_id3_2() + * - mpg123_store_utf8_2() + * - mpg123_par2() + * - mpg123_getpar2() */ #ifndef MPG123_ENUM_API @@ -76,7 +97,7 @@ #ifndef MPG123_PORTABLE_API #include <sys/types.h> -/* A little hack to help MSVC not having ssize_t. */ +/** A little hack to help MSVC not having ssize_t. */ #ifdef _MSC_VER typedef ptrdiff_t mpg123_ssize_t; #else @@ -85,26 +106,61 @@ #endif -/* Handling of large file offsets. - When client code defines _FILE_OFFSET_BITS, it wants non-default large file support, - and thus functions with added suffix (mpg123_open_64). The default library build provides - wrapper and alias functions to accomodate client code variations (dual-mode library like glibc). - - Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling - or enforcing the suffixes. If explicit usage of 64 bit offsets is desired, the int64_t API - (functions with 64 suffix without underscore, notablly mpg123_reader64()) can be used since - API version 48 (mpg123 1.32). - - When in doubt, use the explicit 64 bit functions and avoid off_t in the API. You can define - MPG123_PORTABLE_API to ensure that. That being said, if you and your compiler do not have - problems with the concept of off_t, just use the normal API and be happy. Both 32 and 64 - bit versions will be present where appropriate. -*/ +/** \page lfs Handling of large file offsets + * + * When client code defines _FILE_OFFSET_BITS, it wants non-default large file + * support, and thus functions with added suffix (mpg123_open_64). The default + * library build provides wrapper and alias functions to accomodate client code + * variations (dual-mode library like glibc). + * + * Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, + * respectively, for disabling or enforcing the suffixes. You should *not* do + * this, though, unless you *really* want to deal with symbol ABI yourself. + * If explicit usage of 64 bit offsets is desired, the int64_t API + * consisting of functions with 64 suffix without underscore, notably + * mpg123_reader64(), can be used since API version 48 (mpg123 1.32). A matching + * mpg123_open64(), stripped-down mpg123_open_handle_64() is present since API + * version 49 (mpg123 1.33). + * + * When in doubt, use the explicit 64 bit functions and avoid off_t in the API. + * You can define MPG123_PORTABLE_API to ensure that. That being said, if you + * and your compiler do not have problems with the concept of off_t, just use + * the normal AP like the I/O API of the standard C library. Both 32 and 64 bit + * versions of functions will be present where appropriate. + * + * If your toolchain enforces _FILE_OFFSET_BITS also during build of libmpg123, + * only that setting will be supported for client code. + */ #ifndef MPG123_PORTABLE_API -/* - Now, the renaming of large file aware functions. - By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +/** \page lfs_names Renaming of functions for largefile support + * + * Now, the renaming of large file aware functions. + * By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64() for mpg123_seek()), + * if _FILE_OFFSET_BITS is defined. These are the affected API functions: + * + * - mpg123_open_fixed() + * - mpg123_open() + * - mpg123_open_fd() + * - mpg123_open_handle() + * - mpg123_framebyframe_decode() + * - mpg123_decode_frame() + * - mpg123_tell() + * - mpg123_tellframe() + * - mpg123_tell_stream() + * - mpg123_seek() + * - mpg123_feedseek() + * - mpg123_seek_frame() + * - mpg123_timeframe() + * - mpg123_index() + * - mpg123_set_index() + * - mpg123_position() + * - mpg123_length() + * - mpg123_framelength() + * - mpg123_set_filesize() + * - mpg123_replace_reader() + * - mpg123_replace_reader_handle() + * - mpg123_framepos() */ #if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) @@ -142,6 +198,8 @@ #endif /* largefile hackery */ #endif +/** @} */ + #ifdef __cplusplus extern "C" { #endif @@ -774,7 +832,7 @@ * UTF-8, which also fits any sane modern install of Unix-like systems. * * \param mh handle - * \param path filesystem + * \param path filesystem path * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path); @@ -786,17 +844,63 @@ * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); -#endif /** Use an opaque handle as bitstream input. This works only with the * replaced I/O from mpg123_replace_reader_handle() or mpg123_reader64()! * mpg123_close() will call the cleanup callback for your non-NULL * handle (if you gave one). + * Note that this used to be usable with MPG123_PORTABLE_API defined in + * mpg123 1.32.x and was in fact the only entry point for handle I/O. + * Since mpg123 1.33.0 and API version 49, there is + * mpg123_open_handle64() for the portable case and has to be used + * instead of this function here, even if it _would_ work just fine, + * the inclusion of a largefile-renamed symbol in the portable set was wrong. + * * \param mh handle * \param iohandle your handle * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); +#endif + +/** Open and prepare to decode the specified file by filesystem path. + * This works exactly like mpg123_open() in modern libmpg123, see there + * for more description. This name is not subject to largefile symbol renaming. + * You can also use it with MPG123_PORTABLE_API. + * + * \param mh handle + * \param path filesystem path of your resource + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open64(mpg123_handle *mh, const char *path); + +/** Open a simple MPEG file with fixed properties. + * This is the same as mpg123_open_fixed(), just with a stable + * symbol name for int64_t portable API. + * + * \param mh handle + * \param path filesystem path (see mpg123_open()) + * \param channels allowed channel count, either 1 (MPG123_MONO) or + * 2 (MPG123_STEREO), or bitwise or of them, but then you're halfway back to + * calling mpg123_format() again;-) + * \param encoding a definite encoding from enum mpg123_enc_enum + * or a bitmask like for mpg123_format(), defeating the purpose somewhat + */ +MPG123_EXPORT int mpg123_open_fixed64(mpg123_handle *mh, const char *path +, int channels, int encoding); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_reader64()! + * mpg123_close() will call the cleanup callback for your non-NULL + * handle (if you gave one). + * This is a simplified variant of mpg123_open_handle() that only + * supports the int64_t API, available with MPG123_PORTABLE_API. + * + * \param mh handle + * \param iohandle your handle + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open_handle64(mpg123_handle *mh, void *iohandle); /** Open a new bitstream and prepare for direct feeding * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. @@ -1258,6 +1362,7 @@ /** Set a range of equalizer bands * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. + * \param mh handle * \param a The first equalizer band to set (from 0 to 31) * \param b The last equalizer band to set (from 0 to 31) * \param factor The (linear) adjustment factor, 1 being neutral. @@ -1267,6 +1372,7 @@ , int channel, int a, int b, double factor ); /** Change a range of equalizer bands + * \param mh handle * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. * \param a The first equalizer band to change (from 0 to 31) @@ -2218,7 +2324,8 @@ /** Set up portable read functions on an opaque handle. * The handle is a void pointer, so you can pass any data you want... - * mpg123_open_handle() is the call you make to use the I/O defined here. + * mpg123_open64() (since API 49) or mpg123_open_handle() is the call you make + * to use the I/O defined here. * There is no fallback to internal read/seek here. * Note: As it would be troublesome to mess with this while having a file open, * this mpg123_close() is implied here. Modified: branches/OpenMPT-1.30/include/mpg123/src/include/out123.h ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/include/out123.h Sat Jun 7 20:06:12 2025 (r23412) +++ branches/OpenMPT-1.30/include/mpg123/src/include/out123.h Sat Jun 7 20:06:31 2025 (r23413) @@ -20,7 +20,7 @@ */ #define OUT123_API_VERSION 5 /** library patch level at client build time */ -#define OUT123_PATCHLEVEL 1 +#define OUT123_PATCHLEVEL 2 /* We only need size_t definition. */ #include <stddef.h> Modified: branches/OpenMPT-1.30/include/mpg123/src/include/syn123.h ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/include/syn123.h Sat Jun 7 20:06:12 2025 (r23412) +++ branches/OpenMPT-1.30/include/mpg123/src/include/syn123.h Sat Jun 7 20:06:31 2025 (r23413) @@ -1112,7 +1112,7 @@ // anywhere, also to avoid using non-standard types like ssize_t. #if !defined(SYN123_PORTABLE_API) && !defined(SYN123_NO_LARGEFUNC) -/* A little hack to help MSVC not having ssize_t, duplicated in internal header. */ +/** A little hack to help MSVC not having ssize_t, duplicated in internal header. */ #ifdef _MSC_VER #include <stddef.h> typedef ptrdiff_t syn123_ssize_t; Modified: branches/OpenMPT-1.30/include/mpg123/src/libmpg123/layer2.c ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:06:12 2025 (r23412) +++ branches/OpenMPT-1.30/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:06:31 2025 (r23413) @@ -341,7 +341,8 @@ if(fr->jsbound > fr->II_sblimit) { - fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); + if(NOQUIET) + error("Truncating stereo boundary to sideband limit."); fr->jsbound=fr->II_sblimit; } Modified: branches/OpenMPT-1.30/include/mpg123/src/libmpg123/libmpg123.c ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:06:12 2025 (r23412) +++ branches/OpenMPT-1.30/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:06:31 2025 (r23413) @@ -15,9 +15,7 @@ #define FORCE_ACCURATE #include "../common/sample.h" #include "parse.h" -#ifndef PORTABLE_API #include "lfs_wrap.h" -#endif #include "../common/debug.h" @@ -559,18 +557,9 @@ return mpg123_geteq(mh, channel, band); } -#ifndef PORTABLE_API - -#ifdef FORCED_OFF_64 -// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. -#define mpg123_open mpg123_open_64 -#define mpg123_open_fixed mpg123_open_fixed_64 -#define mpg123_open_fd mpg123_open_fd_64 -#define mpg123_open_handle mpg123_open_handle_64 -#endif - -/* plain file access, no http! */ -int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +// LFS wrapper code is so agnostic to it all now that internal I/O is portable +// as long as you do not mix in off_t API. +int attribute_align_arg mpg123_open64(mpg123_handle *mh, const char *path) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -585,6 +574,24 @@ return ret; } +#ifndef PORTABLE_API + +#ifdef FORCED_OFF_64 +// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. +#define mpg123_open mpg123_open_64 +#define mpg123_open_fixed mpg123_open_fixed_64 +#define mpg123_open_fd mpg123_open_fd_64 +#define mpg123_open_handle mpg123_open_handle_64 +#endif + +// This now is agnostic to off_t choice, but still subject to renaming +// for legacy reasons. +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + return mpg123_open64(mh, path); +} +#endif // PORTABLE_API + // The convenience function mpg123_open_fixed() wraps over acual mpg123_open // and hence needs to have the exact same code in lfs_wrap.c. The flesh is // in INT123_open_fixed_pre() and INT123_open_fixed_post(), wich are only defined here. @@ -624,17 +631,28 @@ return err; } -int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +int attribute_align_arg mpg123_open_fixed64( mpg123_handle *mh, const char *path , int channels, int encoding ) { int err = INT123_open_fixed_pre(mh, channels, encoding); if(err == MPG123_OK) - err = mpg123_open(mh, path); + err = mpg123_open64(mh, path); if(err == MPG123_OK) err = INT123_open_fixed_post(mh, channels, encoding); return err; } +#ifndef PORTABLE_API +// Only to have the modern offset-agnostic open under a fixed name. +int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +, int channels, int encoding ) +{ + return mpg123_open_fixed64(mh, path, channels, encoding); +} + +// Won't define a 'portable' variant of this, as I cannot guess +// properties of the handed-in fd, which in theory, on specific platforms, +// could not support large files. int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -650,21 +668,33 @@ } #endif // PORTABLE_API +// Only works with int64 reader setup. +int attribute_align_arg mpg123_open_handle64(mpg123_handle *mh, void *iohandle) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + return INT123_open_stream_handle(mh, iohandle); +} + +#ifndef PORTABLE_API +// Change from 1.32: No largefile-renamed symbols in a library with strict +// portable API. +// I allow that breaking change since this is far from a standard libmpg123 build. int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle) { if(mh == NULL) return MPG123_BAD_HANDLE; mpg123_close(mh); int ret; -#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, iohandle); return ret; } +#endif int attribute_align_arg mpg123_open_feed(mpg123_handle *mh) { Modified: branches/OpenMPT-1.30/include/mpg123/src/version.h ============================================================================== --- branches/OpenMPT-1.30/include/mpg123/src/version.h Sat Jun 7 20:06:12 2025 (r23412) +++ branches/OpenMPT-1.30/include/mpg123/src/version.h Sat Jun 7 20:06:31 2025 (r23413) @@ -15,8 +15,8 @@ // only single spaces as separator to ease parsing by build scripts #define MPG123_MAJOR 1 -#define MPG123_MINOR 32 -#define MPG123_PATCH 10 +#define MPG123_MINOR 33 +#define MPG123_PATCH 0 // 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 "" |
Author: manx Date: Sat Jun 7 20:06:12 2025 New Revision: 23412 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23412 Log: Merged revision(s) 23410 from trunk/OpenMPT: [Var] mpg123: Update to 1.33.0 (2025-06-07). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt branches/OpenMPT-1.31/include/mpg123/src/compat/compat.c branches/OpenMPT-1.31/include/mpg123/src/compat/compat.h branches/OpenMPT-1.31/include/mpg123/src/include/mpg123.h branches/OpenMPT-1.31/include/mpg123/src/include/out123.h branches/OpenMPT-1.31/include/mpg123/src/include/syn123.h branches/OpenMPT-1.31/include/mpg123/src/libmpg123/layer2.c branches/OpenMPT-1.31/include/mpg123/src/libmpg123/libmpg123.c branches/OpenMPT-1.31/include/mpg123/src/version.h Modified: branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt Sat Jun 7 20:05:32 2025 (r23411) +++ branches/OpenMPT-1.31/include/mpg123/OpenMPT.txt Sat Jun 7 20:06:12 2025 (r23412) @@ -1,9 +1,9 @@ -libmpg123 library version 1.32.10 (2024-12-14). +libmpg123 library version 1.33.0 (2025-06-07). The following changes have been made: * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified for to + * `src/compat/compat.c` and `src/compat/compat.c` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.31/include/mpg123/src/compat/compat.c ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/compat/compat.c Sat Jun 7 20:05:32 2025 (r23411) +++ branches/OpenMPT-1.31/include/mpg123/src/compat/compat.c Sat Jun 7 20:06:12 2025 (r23412) @@ -530,7 +530,7 @@ } #ifndef NO_CATCHSIGNAL -#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) +#if (!defined(WIN32) || defined (__CYGWIN__)) && !defined(__PSP__) && defined(HAVE_SIGNAL_H) void (*INT123_catchsignal(int signum, void(*handler)(int)))(int) { struct sigaction new_sa; Modified: branches/OpenMPT-1.31/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/compat/compat.h Sat Jun 7 20:05:32 2025 (r23411) +++ branches/OpenMPT-1.31/include/mpg123/src/compat/compat.h Sat Jun 7 20:06:12 2025 (r23412) @@ -110,8 +110,17 @@ typedef unsigned char byte; +// Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while +// C11 declares another strtok_s with different prototype. Thanks to you all. +#ifdef HAVE_STRTOK_R +#define INT123_compat_strtok(a, b, c) strtok_r((a), (b), (c)) +#endif + #if (defined(_UCRT) || defined(_MSC_VER) || (defined(__MINGW32__) || defined(__MINGW64__)) || (defined(__WATCOMC__) && defined(__NT__))) && !defined(__CYGWIN__) #define MPG123_COMPAT_MSVCRT_IO +#ifndef INT123_compat_strtok +#define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) +#endif #endif #if defined(MPG123_COMPAT_MSVCRT_IO) @@ -150,6 +159,11 @@ #include <io.h> #endif +#ifndef INT123_compat_strtok +#warning "no safe strtok found" +#define INT123_compat_strtok(a, b, c) strtok((a), (b)) +#endif + /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); // Also freeing ptr if result is NULL. You can do Modified: branches/OpenMPT-1.31/include/mpg123/src/include/mpg123.h ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/include/mpg123.h Sat Jun 7 20:05:32 2025 (r23411) +++ branches/OpenMPT-1.31/include/mpg123/src/include/mpg123.h Sat Jun 7 20:06:12 2025 (r23412) @@ -13,11 +13,15 @@ /** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ +/** \defgroup mpg123_h mpg123 header general settings and notes + * @{ + */ + /** A macro to check at compile time which set of API functions to expect. * This must be incremented at least each time a new symbol is added * to the header. */ -#define MPG123_API_VERSION 48 +#define MPG123_API_VERSION 49 /** library patch level at client build time */ #define MPG123_PATCHLEVEL 3 @@ -43,8 +47,10 @@ #endif #endif -/** Earlier versions of libmpg123 put enums into public API calls, - * thich is not exactly safe. There are ABI rules, but you can use +/** \page enumapi About enum API + * + * Earlier versions of libmpg123 put enums into public API calls, + * which is not exactly safe. There are ABI rules, but you can use * compiler switches to change the sizes of enums. It is safer not * to have them in API calls. Thus, the default is to remap calls and * structs to variants that use plain ints. Define MPG123_ENUM_API to @@ -53,6 +59,21 @@ * You might want to define this to increase the chance of your binary * working with an older version of the library. But if that is your goal, * you should better build with an older version to begin with. + * + * You can avoid renamed symbols by using the non-enum names directly: + * + * - mpg123_param2() + * - mpg123_getparam2() + * - mpg123_feature2() + * - mpg123_eq2() + * - mpg123_geteq2() + * - mpg123_frameinfo2() + * - mpg123_info2() + * - mpg123_getstate2() + * - mpg123_enc_from_id3_2() + * - mpg123_store_utf8_2() + * - mpg123_par2() + * - mpg123_getpar2() */ #ifndef MPG123_ENUM_API @@ -76,7 +97,7 @@ #ifndef MPG123_PORTABLE_API #include <sys/types.h> -/* A little hack to help MSVC not having ssize_t. */ +/** A little hack to help MSVC not having ssize_t. */ #ifdef _MSC_VER typedef ptrdiff_t mpg123_ssize_t; #else @@ -85,26 +106,61 @@ #endif -/* Handling of large file offsets. - When client code defines _FILE_OFFSET_BITS, it wants non-default large file support, - and thus functions with added suffix (mpg123_open_64). The default library build provides - wrapper and alias functions to accomodate client code variations (dual-mode library like glibc). - - Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling - or enforcing the suffixes. If explicit usage of 64 bit offsets is desired, the int64_t API - (functions with 64 suffix without underscore, notablly mpg123_reader64()) can be used since - API version 48 (mpg123 1.32). - - When in doubt, use the explicit 64 bit functions and avoid off_t in the API. You can define - MPG123_PORTABLE_API to ensure that. That being said, if you and your compiler do not have - problems with the concept of off_t, just use the normal API and be happy. Both 32 and 64 - bit versions will be present where appropriate. -*/ +/** \page lfs Handling of large file offsets + * + * When client code defines _FILE_OFFSET_BITS, it wants non-default large file + * support, and thus functions with added suffix (mpg123_open_64). The default + * library build provides wrapper and alias functions to accomodate client code + * variations (dual-mode library like glibc). + * + * Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, + * respectively, for disabling or enforcing the suffixes. You should *not* do + * this, though, unless you *really* want to deal with symbol ABI yourself. + * If explicit usage of 64 bit offsets is desired, the int64_t API + * consisting of functions with 64 suffix without underscore, notably + * mpg123_reader64(), can be used since API version 48 (mpg123 1.32). A matching + * mpg123_open64(), stripped-down mpg123_open_handle_64() is present since API + * version 49 (mpg123 1.33). + * + * When in doubt, use the explicit 64 bit functions and avoid off_t in the API. + * You can define MPG123_PORTABLE_API to ensure that. That being said, if you + * and your compiler do not have problems with the concept of off_t, just use + * the normal AP like the I/O API of the standard C library. Both 32 and 64 bit + * versions of functions will be present where appropriate. + * + * If your toolchain enforces _FILE_OFFSET_BITS also during build of libmpg123, + * only that setting will be supported for client code. + */ #ifndef MPG123_PORTABLE_API -/* - Now, the renaming of large file aware functions. - By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +/** \page lfs_names Renaming of functions for largefile support + * + * Now, the renaming of large file aware functions. + * By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64() for mpg123_seek()), + * if _FILE_OFFSET_BITS is defined. These are the affected API functions: + * + * - mpg123_open_fixed() + * - mpg123_open() + * - mpg123_open_fd() + * - mpg123_open_handle() + * - mpg123_framebyframe_decode() + * - mpg123_decode_frame() + * - mpg123_tell() + * - mpg123_tellframe() + * - mpg123_tell_stream() + * - mpg123_seek() + * - mpg123_feedseek() + * - mpg123_seek_frame() + * - mpg123_timeframe() + * - mpg123_index() + * - mpg123_set_index() + * - mpg123_position() + * - mpg123_length() + * - mpg123_framelength() + * - mpg123_set_filesize() + * - mpg123_replace_reader() + * - mpg123_replace_reader_handle() + * - mpg123_framepos() */ #if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) @@ -142,6 +198,8 @@ #endif /* largefile hackery */ #endif +/** @} */ + #ifdef __cplusplus extern "C" { #endif @@ -774,7 +832,7 @@ * UTF-8, which also fits any sane modern install of Unix-like systems. * * \param mh handle - * \param path filesystem + * \param path filesystem path * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path); @@ -786,17 +844,63 @@ * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); -#endif /** Use an opaque handle as bitstream input. This works only with the * replaced I/O from mpg123_replace_reader_handle() or mpg123_reader64()! * mpg123_close() will call the cleanup callback for your non-NULL * handle (if you gave one). + * Note that this used to be usable with MPG123_PORTABLE_API defined in + * mpg123 1.32.x and was in fact the only entry point for handle I/O. + * Since mpg123 1.33.0 and API version 49, there is + * mpg123_open_handle64() for the portable case and has to be used + * instead of this function here, even if it _would_ work just fine, + * the inclusion of a largefile-renamed symbol in the portable set was wrong. + * * \param mh handle * \param iohandle your handle * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); +#endif + +/** Open and prepare to decode the specified file by filesystem path. + * This works exactly like mpg123_open() in modern libmpg123, see there + * for more description. This name is not subject to largefile symbol renaming. + * You can also use it with MPG123_PORTABLE_API. + * + * \param mh handle + * \param path filesystem path of your resource + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open64(mpg123_handle *mh, const char *path); + +/** Open a simple MPEG file with fixed properties. + * This is the same as mpg123_open_fixed(), just with a stable + * symbol name for int64_t portable API. + * + * \param mh handle + * \param path filesystem path (see mpg123_open()) + * \param channels allowed channel count, either 1 (MPG123_MONO) or + * 2 (MPG123_STEREO), or bitwise or of them, but then you're halfway back to + * calling mpg123_format() again;-) + * \param encoding a definite encoding from enum mpg123_enc_enum + * or a bitmask like for mpg123_format(), defeating the purpose somewhat + */ +MPG123_EXPORT int mpg123_open_fixed64(mpg123_handle *mh, const char *path +, int channels, int encoding); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_reader64()! + * mpg123_close() will call the cleanup callback for your non-NULL + * handle (if you gave one). + * This is a simplified variant of mpg123_open_handle() that only + * supports the int64_t API, available with MPG123_PORTABLE_API. + * + * \param mh handle + * \param iohandle your handle + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open_handle64(mpg123_handle *mh, void *iohandle); /** Open a new bitstream and prepare for direct feeding * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. @@ -1258,6 +1362,7 @@ /** Set a range of equalizer bands * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. + * \param mh handle * \param a The first equalizer band to set (from 0 to 31) * \param b The last equalizer band to set (from 0 to 31) * \param factor The (linear) adjustment factor, 1 being neutral. @@ -1267,6 +1372,7 @@ , int channel, int a, int b, double factor ); /** Change a range of equalizer bands + * \param mh handle * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. * \param a The first equalizer band to change (from 0 to 31) @@ -2218,7 +2324,8 @@ /** Set up portable read functions on an opaque handle. * The handle is a void pointer, so you can pass any data you want... - * mpg123_open_handle() is the call you make to use the I/O defined here. + * mpg123_open64() (since API 49) or mpg123_open_handle() is the call you make + * to use the I/O defined here. * There is no fallback to internal read/seek here. * Note: As it would be troublesome to mess with this while having a file open, * this mpg123_close() is implied here. Modified: branches/OpenMPT-1.31/include/mpg123/src/include/out123.h ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/include/out123.h Sat Jun 7 20:05:32 2025 (r23411) +++ branches/OpenMPT-1.31/include/mpg123/src/include/out123.h Sat Jun 7 20:06:12 2025 (r23412) @@ -20,7 +20,7 @@ */ #define OUT123_API_VERSION 5 /** library patch level at client build time */ -#define OUT123_PATCHLEVEL 1 +#define OUT123_PATCHLEVEL 2 /* We only need size_t definition. */ #include <stddef.h> Modified: branches/OpenMPT-1.31/include/mpg123/src/include/syn123.h ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/include/syn123.h Sat Jun 7 20:05:32 2025 (r23411) +++ branches/OpenMPT-1.31/include/mpg123/src/include/syn123.h Sat Jun 7 20:06:12 2025 (r23412) @@ -1112,7 +1112,7 @@ // anywhere, also to avoid using non-standard types like ssize_t. #if !defined(SYN123_PORTABLE_API) && !defined(SYN123_NO_LARGEFUNC) -/* A little hack to help MSVC not having ssize_t, duplicated in internal header. */ +/** A little hack to help MSVC not having ssize_t, duplicated in internal header. */ #ifdef _MSC_VER #include <stddef.h> typedef ptrdiff_t syn123_ssize_t; Modified: branches/OpenMPT-1.31/include/mpg123/src/libmpg123/layer2.c ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:05:32 2025 (r23411) +++ branches/OpenMPT-1.31/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:06:12 2025 (r23412) @@ -341,7 +341,8 @@ if(fr->jsbound > fr->II_sblimit) { - fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); + if(NOQUIET) + error("Truncating stereo boundary to sideband limit."); fr->jsbound=fr->II_sblimit; } Modified: branches/OpenMPT-1.31/include/mpg123/src/libmpg123/libmpg123.c ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:05:32 2025 (r23411) +++ branches/OpenMPT-1.31/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:06:12 2025 (r23412) @@ -15,9 +15,7 @@ #define FORCE_ACCURATE #include "../common/sample.h" #include "parse.h" -#ifndef PORTABLE_API #include "lfs_wrap.h" -#endif #include "../common/debug.h" @@ -559,18 +557,9 @@ return mpg123_geteq(mh, channel, band); } -#ifndef PORTABLE_API - -#ifdef FORCED_OFF_64 -// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. -#define mpg123_open mpg123_open_64 -#define mpg123_open_fixed mpg123_open_fixed_64 -#define mpg123_open_fd mpg123_open_fd_64 -#define mpg123_open_handle mpg123_open_handle_64 -#endif - -/* plain file access, no http! */ -int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +// LFS wrapper code is so agnostic to it all now that internal I/O is portable +// as long as you do not mix in off_t API. +int attribute_align_arg mpg123_open64(mpg123_handle *mh, const char *path) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -585,6 +574,24 @@ return ret; } +#ifndef PORTABLE_API + +#ifdef FORCED_OFF_64 +// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. +#define mpg123_open mpg123_open_64 +#define mpg123_open_fixed mpg123_open_fixed_64 +#define mpg123_open_fd mpg123_open_fd_64 +#define mpg123_open_handle mpg123_open_handle_64 +#endif + +// This now is agnostic to off_t choice, but still subject to renaming +// for legacy reasons. +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + return mpg123_open64(mh, path); +} +#endif // PORTABLE_API + // The convenience function mpg123_open_fixed() wraps over acual mpg123_open // and hence needs to have the exact same code in lfs_wrap.c. The flesh is // in INT123_open_fixed_pre() and INT123_open_fixed_post(), wich are only defined here. @@ -624,17 +631,28 @@ return err; } -int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +int attribute_align_arg mpg123_open_fixed64( mpg123_handle *mh, const char *path , int channels, int encoding ) { int err = INT123_open_fixed_pre(mh, channels, encoding); if(err == MPG123_OK) - err = mpg123_open(mh, path); + err = mpg123_open64(mh, path); if(err == MPG123_OK) err = INT123_open_fixed_post(mh, channels, encoding); return err; } +#ifndef PORTABLE_API +// Only to have the modern offset-agnostic open under a fixed name. +int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +, int channels, int encoding ) +{ + return mpg123_open_fixed64(mh, path, channels, encoding); +} + +// Won't define a 'portable' variant of this, as I cannot guess +// properties of the handed-in fd, which in theory, on specific platforms, +// could not support large files. int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -650,21 +668,33 @@ } #endif // PORTABLE_API +// Only works with int64 reader setup. +int attribute_align_arg mpg123_open_handle64(mpg123_handle *mh, void *iohandle) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + return INT123_open_stream_handle(mh, iohandle); +} + +#ifndef PORTABLE_API +// Change from 1.32: No largefile-renamed symbols in a library with strict +// portable API. +// I allow that breaking change since this is far from a standard libmpg123 build. int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle) { if(mh == NULL) return MPG123_BAD_HANDLE; mpg123_close(mh); int ret; -#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, iohandle); return ret; } +#endif int attribute_align_arg mpg123_open_feed(mpg123_handle *mh) { Modified: branches/OpenMPT-1.31/include/mpg123/src/version.h ============================================================================== --- branches/OpenMPT-1.31/include/mpg123/src/version.h Sat Jun 7 20:05:32 2025 (r23411) +++ branches/OpenMPT-1.31/include/mpg123/src/version.h Sat Jun 7 20:06:12 2025 (r23412) @@ -15,8 +15,8 @@ // only single spaces as separator to ease parsing by build scripts #define MPG123_MAJOR 1 -#define MPG123_MINOR 32 -#define MPG123_PATCH 10 +#define MPG123_MINOR 33 +#define MPG123_PATCH 0 // 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 "" |
Author: manx Date: Sat Jun 7 20:05:32 2025 New Revision: 23411 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23411 Log: Merged revision(s) 23410 from trunk/OpenMPT: [Var] mpg123: Update to 1.33.0 (2025-06-07). ........ Modified: branches/OpenMPT-1.32/ (props changed) branches/OpenMPT-1.32/include/mpg123/OpenMPT.txt branches/OpenMPT-1.32/include/mpg123/src/compat/compat.c branches/OpenMPT-1.32/include/mpg123/src/compat/compat.h branches/OpenMPT-1.32/include/mpg123/src/include/mpg123.h branches/OpenMPT-1.32/include/mpg123/src/include/out123.h branches/OpenMPT-1.32/include/mpg123/src/include/syn123.h branches/OpenMPT-1.32/include/mpg123/src/libmpg123/layer2.c branches/OpenMPT-1.32/include/mpg123/src/libmpg123/libmpg123.c branches/OpenMPT-1.32/include/mpg123/src/version.h Modified: branches/OpenMPT-1.32/include/mpg123/OpenMPT.txt ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/OpenMPT.txt Sat Jun 7 20:05:09 2025 (r23410) +++ branches/OpenMPT-1.32/include/mpg123/OpenMPT.txt Sat Jun 7 20:05:32 2025 (r23411) @@ -1,9 +1,9 @@ -libmpg123 library version 1.32.10 (2024-12-14). +libmpg123 library version 1.33.0 (2025-06-07). The following changes have been made: * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified for to + * `src/compat/compat.c` and `src/compat/compat.c` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: branches/OpenMPT-1.32/include/mpg123/src/compat/compat.c ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/src/compat/compat.c Sat Jun 7 20:05:09 2025 (r23410) +++ branches/OpenMPT-1.32/include/mpg123/src/compat/compat.c Sat Jun 7 20:05:32 2025 (r23411) @@ -530,7 +530,7 @@ } #ifndef NO_CATCHSIGNAL -#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) +#if (!defined(WIN32) || defined (__CYGWIN__)) && !defined(__PSP__) && defined(HAVE_SIGNAL_H) void (*INT123_catchsignal(int signum, void(*handler)(int)))(int) { struct sigaction new_sa; Modified: branches/OpenMPT-1.32/include/mpg123/src/compat/compat.h ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/src/compat/compat.h Sat Jun 7 20:05:09 2025 (r23410) +++ branches/OpenMPT-1.32/include/mpg123/src/compat/compat.h Sat Jun 7 20:05:32 2025 (r23411) @@ -110,8 +110,17 @@ typedef unsigned char byte; +// Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while +// C11 declares another strtok_s with different prototype. Thanks to you all. +#ifdef HAVE_STRTOK_R +#define INT123_compat_strtok(a, b, c) strtok_r((a), (b), (c)) +#endif + #if (defined(_UCRT) || defined(_MSC_VER) || (defined(__MINGW32__) || defined(__MINGW64__)) || (defined(__WATCOMC__) && defined(__NT__))) && !defined(__CYGWIN__) #define MPG123_COMPAT_MSVCRT_IO +#ifndef INT123_compat_strtok +#define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) +#endif #endif #if defined(MPG123_COMPAT_MSVCRT_IO) @@ -150,6 +159,11 @@ #include <io.h> #endif +#ifndef INT123_compat_strtok +#warning "no safe strtok found" +#define INT123_compat_strtok(a, b, c) strtok((a), (b)) +#endif + /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); // Also freeing ptr if result is NULL. You can do Modified: branches/OpenMPT-1.32/include/mpg123/src/include/mpg123.h ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/src/include/mpg123.h Sat Jun 7 20:05:09 2025 (r23410) +++ branches/OpenMPT-1.32/include/mpg123/src/include/mpg123.h Sat Jun 7 20:05:32 2025 (r23411) @@ -13,11 +13,15 @@ /** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ +/** \defgroup mpg123_h mpg123 header general settings and notes + * @{ + */ + /** A macro to check at compile time which set of API functions to expect. * This must be incremented at least each time a new symbol is added * to the header. */ -#define MPG123_API_VERSION 48 +#define MPG123_API_VERSION 49 /** library patch level at client build time */ #define MPG123_PATCHLEVEL 3 @@ -43,8 +47,10 @@ #endif #endif -/** Earlier versions of libmpg123 put enums into public API calls, - * thich is not exactly safe. There are ABI rules, but you can use +/** \page enumapi About enum API + * + * Earlier versions of libmpg123 put enums into public API calls, + * which is not exactly safe. There are ABI rules, but you can use * compiler switches to change the sizes of enums. It is safer not * to have them in API calls. Thus, the default is to remap calls and * structs to variants that use plain ints. Define MPG123_ENUM_API to @@ -53,6 +59,21 @@ * You might want to define this to increase the chance of your binary * working with an older version of the library. But if that is your goal, * you should better build with an older version to begin with. + * + * You can avoid renamed symbols by using the non-enum names directly: + * + * - mpg123_param2() + * - mpg123_getparam2() + * - mpg123_feature2() + * - mpg123_eq2() + * - mpg123_geteq2() + * - mpg123_frameinfo2() + * - mpg123_info2() + * - mpg123_getstate2() + * - mpg123_enc_from_id3_2() + * - mpg123_store_utf8_2() + * - mpg123_par2() + * - mpg123_getpar2() */ #ifndef MPG123_ENUM_API @@ -76,7 +97,7 @@ #ifndef MPG123_PORTABLE_API #include <sys/types.h> -/* A little hack to help MSVC not having ssize_t. */ +/** A little hack to help MSVC not having ssize_t. */ #ifdef _MSC_VER typedef ptrdiff_t mpg123_ssize_t; #else @@ -85,26 +106,61 @@ #endif -/* Handling of large file offsets. - When client code defines _FILE_OFFSET_BITS, it wants non-default large file support, - and thus functions with added suffix (mpg123_open_64). The default library build provides - wrapper and alias functions to accomodate client code variations (dual-mode library like glibc). - - Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling - or enforcing the suffixes. If explicit usage of 64 bit offsets is desired, the int64_t API - (functions with 64 suffix without underscore, notablly mpg123_reader64()) can be used since - API version 48 (mpg123 1.32). - - When in doubt, use the explicit 64 bit functions and avoid off_t in the API. You can define - MPG123_PORTABLE_API to ensure that. That being said, if you and your compiler do not have - problems with the concept of off_t, just use the normal API and be happy. Both 32 and 64 - bit versions will be present where appropriate. -*/ +/** \page lfs Handling of large file offsets + * + * When client code defines _FILE_OFFSET_BITS, it wants non-default large file + * support, and thus functions with added suffix (mpg123_open_64). The default + * library build provides wrapper and alias functions to accomodate client code + * variations (dual-mode library like glibc). + * + * Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, + * respectively, for disabling or enforcing the suffixes. You should *not* do + * this, though, unless you *really* want to deal with symbol ABI yourself. + * If explicit usage of 64 bit offsets is desired, the int64_t API + * consisting of functions with 64 suffix without underscore, notably + * mpg123_reader64(), can be used since API version 48 (mpg123 1.32). A matching + * mpg123_open64(), stripped-down mpg123_open_handle_64() is present since API + * version 49 (mpg123 1.33). + * + * When in doubt, use the explicit 64 bit functions and avoid off_t in the API. + * You can define MPG123_PORTABLE_API to ensure that. That being said, if you + * and your compiler do not have problems with the concept of off_t, just use + * the normal AP like the I/O API of the standard C library. Both 32 and 64 bit + * versions of functions will be present where appropriate. + * + * If your toolchain enforces _FILE_OFFSET_BITS also during build of libmpg123, + * only that setting will be supported for client code. + */ #ifndef MPG123_PORTABLE_API -/* - Now, the renaming of large file aware functions. - By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +/** \page lfs_names Renaming of functions for largefile support + * + * Now, the renaming of large file aware functions. + * By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64() for mpg123_seek()), + * if _FILE_OFFSET_BITS is defined. These are the affected API functions: + * + * - mpg123_open_fixed() + * - mpg123_open() + * - mpg123_open_fd() + * - mpg123_open_handle() + * - mpg123_framebyframe_decode() + * - mpg123_decode_frame() + * - mpg123_tell() + * - mpg123_tellframe() + * - mpg123_tell_stream() + * - mpg123_seek() + * - mpg123_feedseek() + * - mpg123_seek_frame() + * - mpg123_timeframe() + * - mpg123_index() + * - mpg123_set_index() + * - mpg123_position() + * - mpg123_length() + * - mpg123_framelength() + * - mpg123_set_filesize() + * - mpg123_replace_reader() + * - mpg123_replace_reader_handle() + * - mpg123_framepos() */ #if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) @@ -142,6 +198,8 @@ #endif /* largefile hackery */ #endif +/** @} */ + #ifdef __cplusplus extern "C" { #endif @@ -774,7 +832,7 @@ * UTF-8, which also fits any sane modern install of Unix-like systems. * * \param mh handle - * \param path filesystem + * \param path filesystem path * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path); @@ -786,17 +844,63 @@ * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); -#endif /** Use an opaque handle as bitstream input. This works only with the * replaced I/O from mpg123_replace_reader_handle() or mpg123_reader64()! * mpg123_close() will call the cleanup callback for your non-NULL * handle (if you gave one). + * Note that this used to be usable with MPG123_PORTABLE_API defined in + * mpg123 1.32.x and was in fact the only entry point for handle I/O. + * Since mpg123 1.33.0 and API version 49, there is + * mpg123_open_handle64() for the portable case and has to be used + * instead of this function here, even if it _would_ work just fine, + * the inclusion of a largefile-renamed symbol in the portable set was wrong. + * * \param mh handle * \param iohandle your handle * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); +#endif + +/** Open and prepare to decode the specified file by filesystem path. + * This works exactly like mpg123_open() in modern libmpg123, see there + * for more description. This name is not subject to largefile symbol renaming. + * You can also use it with MPG123_PORTABLE_API. + * + * \param mh handle + * \param path filesystem path of your resource + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open64(mpg123_handle *mh, const char *path); + +/** Open a simple MPEG file with fixed properties. + * This is the same as mpg123_open_fixed(), just with a stable + * symbol name for int64_t portable API. + * + * \param mh handle + * \param path filesystem path (see mpg123_open()) + * \param channels allowed channel count, either 1 (MPG123_MONO) or + * 2 (MPG123_STEREO), or bitwise or of them, but then you're halfway back to + * calling mpg123_format() again;-) + * \param encoding a definite encoding from enum mpg123_enc_enum + * or a bitmask like for mpg123_format(), defeating the purpose somewhat + */ +MPG123_EXPORT int mpg123_open_fixed64(mpg123_handle *mh, const char *path +, int channels, int encoding); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_reader64()! + * mpg123_close() will call the cleanup callback for your non-NULL + * handle (if you gave one). + * This is a simplified variant of mpg123_open_handle() that only + * supports the int64_t API, available with MPG123_PORTABLE_API. + * + * \param mh handle + * \param iohandle your handle + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open_handle64(mpg123_handle *mh, void *iohandle); /** Open a new bitstream and prepare for direct feeding * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. @@ -1258,6 +1362,7 @@ /** Set a range of equalizer bands * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. + * \param mh handle * \param a The first equalizer band to set (from 0 to 31) * \param b The last equalizer band to set (from 0 to 31) * \param factor The (linear) adjustment factor, 1 being neutral. @@ -1267,6 +1372,7 @@ , int channel, int a, int b, double factor ); /** Change a range of equalizer bands + * \param mh handle * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. * \param a The first equalizer band to change (from 0 to 31) @@ -2218,7 +2324,8 @@ /** Set up portable read functions on an opaque handle. * The handle is a void pointer, so you can pass any data you want... - * mpg123_open_handle() is the call you make to use the I/O defined here. + * mpg123_open64() (since API 49) or mpg123_open_handle() is the call you make + * to use the I/O defined here. * There is no fallback to internal read/seek here. * Note: As it would be troublesome to mess with this while having a file open, * this mpg123_close() is implied here. Modified: branches/OpenMPT-1.32/include/mpg123/src/include/out123.h ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/src/include/out123.h Sat Jun 7 20:05:09 2025 (r23410) +++ branches/OpenMPT-1.32/include/mpg123/src/include/out123.h Sat Jun 7 20:05:32 2025 (r23411) @@ -20,7 +20,7 @@ */ #define OUT123_API_VERSION 5 /** library patch level at client build time */ -#define OUT123_PATCHLEVEL 1 +#define OUT123_PATCHLEVEL 2 /* We only need size_t definition. */ #include <stddef.h> Modified: branches/OpenMPT-1.32/include/mpg123/src/include/syn123.h ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/src/include/syn123.h Sat Jun 7 20:05:09 2025 (r23410) +++ branches/OpenMPT-1.32/include/mpg123/src/include/syn123.h Sat Jun 7 20:05:32 2025 (r23411) @@ -1112,7 +1112,7 @@ // anywhere, also to avoid using non-standard types like ssize_t. #if !defined(SYN123_PORTABLE_API) && !defined(SYN123_NO_LARGEFUNC) -/* A little hack to help MSVC not having ssize_t, duplicated in internal header. */ +/** A little hack to help MSVC not having ssize_t, duplicated in internal header. */ #ifdef _MSC_VER #include <stddef.h> typedef ptrdiff_t syn123_ssize_t; Modified: branches/OpenMPT-1.32/include/mpg123/src/libmpg123/layer2.c ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:05:09 2025 (r23410) +++ branches/OpenMPT-1.32/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:05:32 2025 (r23411) @@ -341,7 +341,8 @@ if(fr->jsbound > fr->II_sblimit) { - fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); + if(NOQUIET) + error("Truncating stereo boundary to sideband limit."); fr->jsbound=fr->II_sblimit; } Modified: branches/OpenMPT-1.32/include/mpg123/src/libmpg123/libmpg123.c ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:05:09 2025 (r23410) +++ branches/OpenMPT-1.32/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:05:32 2025 (r23411) @@ -15,9 +15,7 @@ #define FORCE_ACCURATE #include "../common/sample.h" #include "parse.h" -#ifndef PORTABLE_API #include "lfs_wrap.h" -#endif #include "../common/debug.h" @@ -559,18 +557,9 @@ return mpg123_geteq(mh, channel, band); } -#ifndef PORTABLE_API - -#ifdef FORCED_OFF_64 -// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. -#define mpg123_open mpg123_open_64 -#define mpg123_open_fixed mpg123_open_fixed_64 -#define mpg123_open_fd mpg123_open_fd_64 -#define mpg123_open_handle mpg123_open_handle_64 -#endif - -/* plain file access, no http! */ -int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +// LFS wrapper code is so agnostic to it all now that internal I/O is portable +// as long as you do not mix in off_t API. +int attribute_align_arg mpg123_open64(mpg123_handle *mh, const char *path) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -585,6 +574,24 @@ return ret; } +#ifndef PORTABLE_API + +#ifdef FORCED_OFF_64 +// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. +#define mpg123_open mpg123_open_64 +#define mpg123_open_fixed mpg123_open_fixed_64 +#define mpg123_open_fd mpg123_open_fd_64 +#define mpg123_open_handle mpg123_open_handle_64 +#endif + +// This now is agnostic to off_t choice, but still subject to renaming +// for legacy reasons. +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + return mpg123_open64(mh, path); +} +#endif // PORTABLE_API + // The convenience function mpg123_open_fixed() wraps over acual mpg123_open // and hence needs to have the exact same code in lfs_wrap.c. The flesh is // in INT123_open_fixed_pre() and INT123_open_fixed_post(), wich are only defined here. @@ -624,17 +631,28 @@ return err; } -int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +int attribute_align_arg mpg123_open_fixed64( mpg123_handle *mh, const char *path , int channels, int encoding ) { int err = INT123_open_fixed_pre(mh, channels, encoding); if(err == MPG123_OK) - err = mpg123_open(mh, path); + err = mpg123_open64(mh, path); if(err == MPG123_OK) err = INT123_open_fixed_post(mh, channels, encoding); return err; } +#ifndef PORTABLE_API +// Only to have the modern offset-agnostic open under a fixed name. +int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +, int channels, int encoding ) +{ + return mpg123_open_fixed64(mh, path, channels, encoding); +} + +// Won't define a 'portable' variant of this, as I cannot guess +// properties of the handed-in fd, which in theory, on specific platforms, +// could not support large files. int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -650,21 +668,33 @@ } #endif // PORTABLE_API +// Only works with int64 reader setup. +int attribute_align_arg mpg123_open_handle64(mpg123_handle *mh, void *iohandle) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + return INT123_open_stream_handle(mh, iohandle); +} + +#ifndef PORTABLE_API +// Change from 1.32: No largefile-renamed symbols in a library with strict +// portable API. +// I allow that breaking change since this is far from a standard libmpg123 build. int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle) { if(mh == NULL) return MPG123_BAD_HANDLE; mpg123_close(mh); int ret; -#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, iohandle); return ret; } +#endif int attribute_align_arg mpg123_open_feed(mpg123_handle *mh) { Modified: branches/OpenMPT-1.32/include/mpg123/src/version.h ============================================================================== --- branches/OpenMPT-1.32/include/mpg123/src/version.h Sat Jun 7 20:05:09 2025 (r23410) +++ branches/OpenMPT-1.32/include/mpg123/src/version.h Sat Jun 7 20:05:32 2025 (r23411) @@ -15,8 +15,8 @@ // only single spaces as separator to ease parsing by build scripts #define MPG123_MAJOR 1 -#define MPG123_MINOR 32 -#define MPG123_PATCH 10 +#define MPG123_MINOR 33 +#define MPG123_PATCH 0 // 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 "" |
From: <sv...@op...> - 2025-06-07 18:05:22
|
Author: manx Date: Sat Jun 7 20:05:09 2025 New Revision: 23410 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23410 Log: [Var] mpg123: Update to 1.33.0 (2025-06-07). Modified: trunk/OpenMPT/include/mpg123/OpenMPT.txt trunk/OpenMPT/include/mpg123/src/compat/compat.c trunk/OpenMPT/include/mpg123/src/compat/compat.h trunk/OpenMPT/include/mpg123/src/include/mpg123.h trunk/OpenMPT/include/mpg123/src/include/out123.h trunk/OpenMPT/include/mpg123/src/include/syn123.h trunk/OpenMPT/include/mpg123/src/libmpg123/layer2.c trunk/OpenMPT/include/mpg123/src/libmpg123/libmpg123.c trunk/OpenMPT/include/mpg123/src/version.h Modified: trunk/OpenMPT/include/mpg123/OpenMPT.txt ============================================================================== --- trunk/OpenMPT/include/mpg123/OpenMPT.txt Sat Jun 7 20:04:30 2025 (r23409) +++ trunk/OpenMPT/include/mpg123/OpenMPT.txt Sat Jun 7 20:05:09 2025 (r23410) @@ -1,9 +1,9 @@ -libmpg123 library version 1.32.10 (2024-12-14). +libmpg123 library version 1.33.0 (2025-06-07). The following changes have been made: * `ports/generic/config.h` has been added for build system independent builds. * `src/compat/compat.c` has been modified to silence MSVC static analyzer warnings. - * `src/compat/compat.c` and `src/compat/compat.c` have been modified for to + * `src/compat/compat.c` and `src/compat/compat.c` have been modified to exclude unneeded functionality. * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. Modified: trunk/OpenMPT/include/mpg123/src/compat/compat.c ============================================================================== --- trunk/OpenMPT/include/mpg123/src/compat/compat.c Sat Jun 7 20:04:30 2025 (r23409) +++ trunk/OpenMPT/include/mpg123/src/compat/compat.c Sat Jun 7 20:05:09 2025 (r23410) @@ -530,7 +530,7 @@ } #ifndef NO_CATCHSIGNAL -#if (!defined(WIN32) || defined (__CYGWIN__)) && defined(HAVE_SIGNAL_H) +#if (!defined(WIN32) || defined (__CYGWIN__)) && !defined(__PSP__) && defined(HAVE_SIGNAL_H) void (*INT123_catchsignal(int signum, void(*handler)(int)))(int) { struct sigaction new_sa; Modified: trunk/OpenMPT/include/mpg123/src/compat/compat.h ============================================================================== --- trunk/OpenMPT/include/mpg123/src/compat/compat.h Sat Jun 7 20:04:30 2025 (r23409) +++ trunk/OpenMPT/include/mpg123/src/compat/compat.h Sat Jun 7 20:05:09 2025 (r23410) @@ -110,8 +110,17 @@ typedef unsigned char byte; +// Annoying hackery to select a safe strtok variant. MS decided to call their strtok_r strtok_s, while +// C11 declares another strtok_s with different prototype. Thanks to you all. +#ifdef HAVE_STRTOK_R +#define INT123_compat_strtok(a, b, c) strtok_r((a), (b), (c)) +#endif + #if (defined(_UCRT) || defined(_MSC_VER) || (defined(__MINGW32__) || defined(__MINGW64__)) || (defined(__WATCOMC__) && defined(__NT__))) && !defined(__CYGWIN__) #define MPG123_COMPAT_MSVCRT_IO +#ifndef INT123_compat_strtok +#define INT123_compat_strtok(a, b, c) strtok_s((a), (b), (c)) +#endif #endif #if defined(MPG123_COMPAT_MSVCRT_IO) @@ -150,6 +159,11 @@ #include <io.h> #endif +#ifndef INT123_compat_strtok +#warning "no safe strtok found" +#define INT123_compat_strtok(a, b, c) strtok((a), (b)) +#endif + /* A safe realloc also for very old systems where realloc(NULL, size) returns NULL. */ void *INT123_safe_realloc(void *ptr, size_t size); // Also freeing ptr if result is NULL. You can do Modified: trunk/OpenMPT/include/mpg123/src/include/mpg123.h ============================================================================== --- trunk/OpenMPT/include/mpg123/src/include/mpg123.h Sat Jun 7 20:04:30 2025 (r23409) +++ trunk/OpenMPT/include/mpg123/src/include/mpg123.h Sat Jun 7 20:05:09 2025 (r23410) @@ -13,11 +13,15 @@ /** \file mpg123.h The header file for the libmpg123 MPEG Audio decoder */ +/** \defgroup mpg123_h mpg123 header general settings and notes + * @{ + */ + /** A macro to check at compile time which set of API functions to expect. * This must be incremented at least each time a new symbol is added * to the header. */ -#define MPG123_API_VERSION 48 +#define MPG123_API_VERSION 49 /** library patch level at client build time */ #define MPG123_PATCHLEVEL 3 @@ -43,8 +47,10 @@ #endif #endif -/** Earlier versions of libmpg123 put enums into public API calls, - * thich is not exactly safe. There are ABI rules, but you can use +/** \page enumapi About enum API + * + * Earlier versions of libmpg123 put enums into public API calls, + * which is not exactly safe. There are ABI rules, but you can use * compiler switches to change the sizes of enums. It is safer not * to have them in API calls. Thus, the default is to remap calls and * structs to variants that use plain ints. Define MPG123_ENUM_API to @@ -53,6 +59,21 @@ * You might want to define this to increase the chance of your binary * working with an older version of the library. But if that is your goal, * you should better build with an older version to begin with. + * + * You can avoid renamed symbols by using the non-enum names directly: + * + * - mpg123_param2() + * - mpg123_getparam2() + * - mpg123_feature2() + * - mpg123_eq2() + * - mpg123_geteq2() + * - mpg123_frameinfo2() + * - mpg123_info2() + * - mpg123_getstate2() + * - mpg123_enc_from_id3_2() + * - mpg123_store_utf8_2() + * - mpg123_par2() + * - mpg123_getpar2() */ #ifndef MPG123_ENUM_API @@ -76,7 +97,7 @@ #ifndef MPG123_PORTABLE_API #include <sys/types.h> -/* A little hack to help MSVC not having ssize_t. */ +/** A little hack to help MSVC not having ssize_t. */ #ifdef _MSC_VER typedef ptrdiff_t mpg123_ssize_t; #else @@ -85,26 +106,61 @@ #endif -/* Handling of large file offsets. - When client code defines _FILE_OFFSET_BITS, it wants non-default large file support, - and thus functions with added suffix (mpg123_open_64). The default library build provides - wrapper and alias functions to accomodate client code variations (dual-mode library like glibc). - - Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, respectively, for disabling - or enforcing the suffixes. If explicit usage of 64 bit offsets is desired, the int64_t API - (functions with 64 suffix without underscore, notablly mpg123_reader64()) can be used since - API version 48 (mpg123 1.32). - - When in doubt, use the explicit 64 bit functions and avoid off_t in the API. You can define - MPG123_PORTABLE_API to ensure that. That being said, if you and your compiler do not have - problems with the concept of off_t, just use the normal API and be happy. Both 32 and 64 - bit versions will be present where appropriate. -*/ +/** \page lfs Handling of large file offsets + * + * When client code defines _FILE_OFFSET_BITS, it wants non-default large file + * support, and thus functions with added suffix (mpg123_open_64). The default + * library build provides wrapper and alias functions to accomodate client code + * variations (dual-mode library like glibc). + * + * Client code can definie MPG123_NO_LARGENAME and MPG123_LARGESUFFIX, + * respectively, for disabling or enforcing the suffixes. You should *not* do + * this, though, unless you *really* want to deal with symbol ABI yourself. + * If explicit usage of 64 bit offsets is desired, the int64_t API + * consisting of functions with 64 suffix without underscore, notably + * mpg123_reader64(), can be used since API version 48 (mpg123 1.32). A matching + * mpg123_open64(), stripped-down mpg123_open_handle_64() is present since API + * version 49 (mpg123 1.33). + * + * When in doubt, use the explicit 64 bit functions and avoid off_t in the API. + * You can define MPG123_PORTABLE_API to ensure that. That being said, if you + * and your compiler do not have problems with the concept of off_t, just use + * the normal AP like the I/O API of the standard C library. Both 32 and 64 bit + * versions of functions will be present where appropriate. + * + * If your toolchain enforces _FILE_OFFSET_BITS also during build of libmpg123, + * only that setting will be supported for client code. + */ #ifndef MPG123_PORTABLE_API -/* - Now, the renaming of large file aware functions. - By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64 for mpg123_seek), if _FILE_OFFSET_BITS is defined. You can force a different suffix via MPG123_LARGESUFFIX (that must include the underscore), or you can just disable the whole mess by defining MPG123_NO_LARGENAME. +/** \page lfs_names Renaming of functions for largefile support + * + * Now, the renaming of large file aware functions. + * By default, it appends underscore _FILE_OFFSET_BITS (so, mpg123_seek_64() for mpg123_seek()), + * if _FILE_OFFSET_BITS is defined. These are the affected API functions: + * + * - mpg123_open_fixed() + * - mpg123_open() + * - mpg123_open_fd() + * - mpg123_open_handle() + * - mpg123_framebyframe_decode() + * - mpg123_decode_frame() + * - mpg123_tell() + * - mpg123_tellframe() + * - mpg123_tell_stream() + * - mpg123_seek() + * - mpg123_feedseek() + * - mpg123_seek_frame() + * - mpg123_timeframe() + * - mpg123_index() + * - mpg123_set_index() + * - mpg123_position() + * - mpg123_length() + * - mpg123_framelength() + * - mpg123_set_filesize() + * - mpg123_replace_reader() + * - mpg123_replace_reader_handle() + * - mpg123_framepos() */ #if (!defined MPG123_NO_LARGENAME) && ((defined _FILE_OFFSET_BITS) || (defined MPG123_LARGESUFFIX)) @@ -142,6 +198,8 @@ #endif /* largefile hackery */ #endif +/** @} */ + #ifdef __cplusplus extern "C" { #endif @@ -774,7 +832,7 @@ * UTF-8, which also fits any sane modern install of Unix-like systems. * * \param mh handle - * \param path filesystem + * \param path filesystem path * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open(mpg123_handle *mh, const char *path); @@ -786,17 +844,63 @@ * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_fd(mpg123_handle *mh, int fd); -#endif /** Use an opaque handle as bitstream input. This works only with the * replaced I/O from mpg123_replace_reader_handle() or mpg123_reader64()! * mpg123_close() will call the cleanup callback for your non-NULL * handle (if you gave one). + * Note that this used to be usable with MPG123_PORTABLE_API defined in + * mpg123 1.32.x and was in fact the only entry point for handle I/O. + * Since mpg123 1.33.0 and API version 49, there is + * mpg123_open_handle64() for the portable case and has to be used + * instead of this function here, even if it _would_ work just fine, + * the inclusion of a largefile-renamed symbol in the portable set was wrong. + * * \param mh handle * \param iohandle your handle * \return MPG123_OK on success */ MPG123_EXPORT int mpg123_open_handle(mpg123_handle *mh, void *iohandle); +#endif + +/** Open and prepare to decode the specified file by filesystem path. + * This works exactly like mpg123_open() in modern libmpg123, see there + * for more description. This name is not subject to largefile symbol renaming. + * You can also use it with MPG123_PORTABLE_API. + * + * \param mh handle + * \param path filesystem path of your resource + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open64(mpg123_handle *mh, const char *path); + +/** Open a simple MPEG file with fixed properties. + * This is the same as mpg123_open_fixed(), just with a stable + * symbol name for int64_t portable API. + * + * \param mh handle + * \param path filesystem path (see mpg123_open()) + * \param channels allowed channel count, either 1 (MPG123_MONO) or + * 2 (MPG123_STEREO), or bitwise or of them, but then you're halfway back to + * calling mpg123_format() again;-) + * \param encoding a definite encoding from enum mpg123_enc_enum + * or a bitmask like for mpg123_format(), defeating the purpose somewhat + */ +MPG123_EXPORT int mpg123_open_fixed64(mpg123_handle *mh, const char *path +, int channels, int encoding); + +/** Use an opaque handle as bitstream input. This works only with the + * replaced I/O from mpg123_reader64()! + * mpg123_close() will call the cleanup callback for your non-NULL + * handle (if you gave one). + * This is a simplified variant of mpg123_open_handle() that only + * supports the int64_t API, available with MPG123_PORTABLE_API. + * + * \param mh handle + * \param iohandle your handle + * \return MPG123_OK on success + */ +MPG123_EXPORT int mpg123_open_handle64(mpg123_handle *mh, void *iohandle); /** Open a new bitstream and prepare for direct feeding * This works together with mpg123_decode(); you are responsible for reading and feeding the input bitstream. @@ -1258,6 +1362,7 @@ /** Set a range of equalizer bands * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. + * \param mh handle * \param a The first equalizer band to set (from 0 to 31) * \param b The last equalizer band to set (from 0 to 31) * \param factor The (linear) adjustment factor, 1 being neutral. @@ -1267,6 +1372,7 @@ , int channel, int a, int b, double factor ); /** Change a range of equalizer bands + * \param mh handle * \param channel Can be #MPG123_LEFT, #MPG123_RIGHT or * #MPG123_LEFT|#MPG123_RIGHT for both. * \param a The first equalizer band to change (from 0 to 31) @@ -2218,7 +2324,8 @@ /** Set up portable read functions on an opaque handle. * The handle is a void pointer, so you can pass any data you want... - * mpg123_open_handle() is the call you make to use the I/O defined here. + * mpg123_open64() (since API 49) or mpg123_open_handle() is the call you make + * to use the I/O defined here. * There is no fallback to internal read/seek here. * Note: As it would be troublesome to mess with this while having a file open, * this mpg123_close() is implied here. Modified: trunk/OpenMPT/include/mpg123/src/include/out123.h ============================================================================== --- trunk/OpenMPT/include/mpg123/src/include/out123.h Sat Jun 7 20:04:30 2025 (r23409) +++ trunk/OpenMPT/include/mpg123/src/include/out123.h Sat Jun 7 20:05:09 2025 (r23410) @@ -20,7 +20,7 @@ */ #define OUT123_API_VERSION 5 /** library patch level at client build time */ -#define OUT123_PATCHLEVEL 1 +#define OUT123_PATCHLEVEL 2 /* We only need size_t definition. */ #include <stddef.h> Modified: trunk/OpenMPT/include/mpg123/src/include/syn123.h ============================================================================== --- trunk/OpenMPT/include/mpg123/src/include/syn123.h Sat Jun 7 20:04:30 2025 (r23409) +++ trunk/OpenMPT/include/mpg123/src/include/syn123.h Sat Jun 7 20:05:09 2025 (r23410) @@ -1112,7 +1112,7 @@ // anywhere, also to avoid using non-standard types like ssize_t. #if !defined(SYN123_PORTABLE_API) && !defined(SYN123_NO_LARGEFUNC) -/* A little hack to help MSVC not having ssize_t, duplicated in internal header. */ +/** A little hack to help MSVC not having ssize_t, duplicated in internal header. */ #ifdef _MSC_VER #include <stddef.h> typedef ptrdiff_t syn123_ssize_t; Modified: trunk/OpenMPT/include/mpg123/src/libmpg123/layer2.c ============================================================================== --- trunk/OpenMPT/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:04:30 2025 (r23409) +++ trunk/OpenMPT/include/mpg123/src/libmpg123/layer2.c Sat Jun 7 20:05:09 2025 (r23410) @@ -341,7 +341,8 @@ if(fr->jsbound > fr->II_sblimit) { - fprintf(stderr, "Truncating stereo boundary to sideband limit.\n"); + if(NOQUIET) + error("Truncating stereo boundary to sideband limit."); fr->jsbound=fr->II_sblimit; } Modified: trunk/OpenMPT/include/mpg123/src/libmpg123/libmpg123.c ============================================================================== --- trunk/OpenMPT/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:04:30 2025 (r23409) +++ trunk/OpenMPT/include/mpg123/src/libmpg123/libmpg123.c Sat Jun 7 20:05:09 2025 (r23410) @@ -15,9 +15,7 @@ #define FORCE_ACCURATE #include "../common/sample.h" #include "parse.h" -#ifndef PORTABLE_API #include "lfs_wrap.h" -#endif #include "../common/debug.h" @@ -559,18 +557,9 @@ return mpg123_geteq(mh, channel, band); } -#ifndef PORTABLE_API - -#ifdef FORCED_OFF_64 -// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. -#define mpg123_open mpg123_open_64 -#define mpg123_open_fixed mpg123_open_fixed_64 -#define mpg123_open_fd mpg123_open_fd_64 -#define mpg123_open_handle mpg123_open_handle_64 -#endif - -/* plain file access, no http! */ -int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +// LFS wrapper code is so agnostic to it all now that internal I/O is portable +// as long as you do not mix in off_t API. +int attribute_align_arg mpg123_open64(mpg123_handle *mh, const char *path) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -585,6 +574,24 @@ return ret; } +#ifndef PORTABLE_API + +#ifdef FORCED_OFF_64 +// Only _64 symbols for a system-wide enforced _FILE_OFFSET_BITS=64. +#define mpg123_open mpg123_open_64 +#define mpg123_open_fixed mpg123_open_fixed_64 +#define mpg123_open_fd mpg123_open_fd_64 +#define mpg123_open_handle mpg123_open_handle_64 +#endif + +// This now is agnostic to off_t choice, but still subject to renaming +// for legacy reasons. +int attribute_align_arg mpg123_open(mpg123_handle *mh, const char *path) +{ + return mpg123_open64(mh, path); +} +#endif // PORTABLE_API + // The convenience function mpg123_open_fixed() wraps over acual mpg123_open // and hence needs to have the exact same code in lfs_wrap.c. The flesh is // in INT123_open_fixed_pre() and INT123_open_fixed_post(), wich are only defined here. @@ -624,17 +631,28 @@ return err; } -int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +int attribute_align_arg mpg123_open_fixed64( mpg123_handle *mh, const char *path , int channels, int encoding ) { int err = INT123_open_fixed_pre(mh, channels, encoding); if(err == MPG123_OK) - err = mpg123_open(mh, path); + err = mpg123_open64(mh, path); if(err == MPG123_OK) err = INT123_open_fixed_post(mh, channels, encoding); return err; } +#ifndef PORTABLE_API +// Only to have the modern offset-agnostic open under a fixed name. +int attribute_align_arg mpg123_open_fixed( mpg123_handle *mh, const char *path +, int channels, int encoding ) +{ + return mpg123_open_fixed64(mh, path, channels, encoding); +} + +// Won't define a 'portable' variant of this, as I cannot guess +// properties of the handed-in fd, which in theory, on specific platforms, +// could not support large files. int attribute_align_arg mpg123_open_fd(mpg123_handle *mh, int fd) { if(mh == NULL) return MPG123_BAD_HANDLE; @@ -650,21 +668,33 @@ } #endif // PORTABLE_API +// Only works with int64 reader setup. +int attribute_align_arg mpg123_open_handle64(mpg123_handle *mh, void *iohandle) +{ + if(mh == NULL) return MPG123_BAD_HANDLE; + + mpg123_close(mh); + return INT123_open_stream_handle(mh, iohandle); +} + +#ifndef PORTABLE_API +// Change from 1.32: No largefile-renamed symbols in a library with strict +// portable API. +// I allow that breaking change since this is far from a standard libmpg123 build. int attribute_align_arg mpg123_open_handle(mpg123_handle *mh, void *iohandle) { if(mh == NULL) return MPG123_BAD_HANDLE; mpg123_close(mh); int ret; -#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, iohandle); return ret; } +#endif int attribute_align_arg mpg123_open_feed(mpg123_handle *mh) { Modified: trunk/OpenMPT/include/mpg123/src/version.h ============================================================================== --- trunk/OpenMPT/include/mpg123/src/version.h Sat Jun 7 20:04:30 2025 (r23409) +++ trunk/OpenMPT/include/mpg123/src/version.h Sat Jun 7 20:05:09 2025 (r23410) @@ -15,8 +15,8 @@ // only single spaces as separator to ease parsing by build scripts #define MPG123_MAJOR 1 -#define MPG123_MINOR 32 -#define MPG123_PATCH 10 +#define MPG123_MINOR 33 +#define MPG123_PATCH 0 // 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 "" |
From: <sv...@op...> - 2025-06-07 18:04:42
|
Author: manx Date: Sat Jun 7 20:04:30 2025 New Revision: 23409 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23409 Log: [Doc] libopenmpt: Update changelog. Modified: branches/OpenMPT-1.32/doc/libopenmpt/changelog.md Modified: branches/OpenMPT-1.32/doc/libopenmpt/changelog.md ============================================================================== --- branches/OpenMPT-1.32/doc/libopenmpt/changelog.md Sat Jun 7 20:02:11 2025 (r23408) +++ branches/OpenMPT-1.32/doc/libopenmpt/changelog.md Sat Jun 7 20:04:30 2025 (r23409) @@ -15,6 +15,8 @@ and Fujiology use this extension for TCB Tracker modules, instead of the canonical .MOD extension. + * Building with libmpg123 1.33.0 in PORTABLE_API mode now works. + * miniz: v3.0.2 (2023-01-15). ### libopenmpt 0.8.0 (2025-05-31) |
From: <sv...@op...> - 2025-06-07 18:02:17
|
Author: manx Date: Sat Jun 7 20:02:11 2025 New Revision: 23408 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23408 Log: Merged revision(s) 23407 from trunk/OpenMPT: [Fix] MP3 Samples: libmpg123: Fix build with PORTABLE_API builds of libmpg123 1.33.0 or later. ........ Modified: branches/OpenMPT-1.32/ (props changed) branches/OpenMPT-1.32/soundlib/SampleFormatMP3.cpp Modified: branches/OpenMPT-1.32/soundlib/SampleFormatMP3.cpp ============================================================================== --- branches/OpenMPT-1.32/soundlib/SampleFormatMP3.cpp Sat Jun 7 20:01:27 2025 (r23407) +++ branches/OpenMPT-1.32/soundlib/SampleFormatMP3.cpp Sat Jun 7 20:02:11 2025 (r23408) @@ -366,10 +366,17 @@ return false; } #endif +#if (MPG123_API_VERSION >= 49) && MPT_USE_MPG123_PORTABLE_API + if(mpg123_open_handle64(mh, &file)) + { + return false; + } +#else if(mpg123_open_handle(mh, &file)) { return false; } +#endif if(mpg123_scan(mh)) { return false; @@ -456,10 +463,17 @@ return false; } #endif +#if (MPG123_API_VERSION >= 49) && MPT_USE_MPG123_PORTABLE_API + if(mpg123_open_handle64(mh, &file)) + { + return false; + } +#else if(mpg123_open_handle(mh, &file)) { return false; } +#endif if(mpg123_scan(mh)) { return false; @@ -550,10 +564,17 @@ return false; } #endif +#if (MPG123_API_VERSION >= 49) && MPT_USE_MPG123_PORTABLE_API + if(mpg123_open_handle64(mh, &file)) + { + return false; + } +#else if(mpg123_open_handle(mh, &file)) { return false; } +#endif if(mpg123_scan(mh)) { return false; |
From: <sv...@op...> - 2025-06-07 18:01:39
|
Author: manx Date: Sat Jun 7 20:01:27 2025 New Revision: 23407 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23407 Log: [Fix] MP3 Samples: libmpg123: Fix build with PORTABLE_API builds of libmpg123 1.33.0 or later. Modified: trunk/OpenMPT/soundlib/SampleFormatMP3.cpp Modified: trunk/OpenMPT/soundlib/SampleFormatMP3.cpp ============================================================================== --- trunk/OpenMPT/soundlib/SampleFormatMP3.cpp Sat Jun 7 19:27:26 2025 (r23406) +++ trunk/OpenMPT/soundlib/SampleFormatMP3.cpp Sat Jun 7 20:01:27 2025 (r23407) @@ -366,10 +366,17 @@ return false; } #endif +#if (MPG123_API_VERSION >= 49) && MPT_USE_MPG123_PORTABLE_API + if(mpg123_open_handle64(mh, &file)) + { + return false; + } +#else if(mpg123_open_handle(mh, &file)) { return false; } +#endif if(mpg123_scan(mh)) { return false; @@ -456,10 +463,17 @@ return false; } #endif +#if (MPG123_API_VERSION >= 49) && MPT_USE_MPG123_PORTABLE_API + if(mpg123_open_handle64(mh, &file)) + { + return false; + } +#else if(mpg123_open_handle(mh, &file)) { return false; } +#endif if(mpg123_scan(mh)) { return false; @@ -550,10 +564,17 @@ return false; } #endif +#if (MPG123_API_VERSION >= 49) && MPT_USE_MPG123_PORTABLE_API + if(mpg123_open_handle64(mh, &file)) + { + return false; + } +#else if(mpg123_open_handle(mh, &file)) { return false; } +#endif if(mpg123_scan(mh)) { return false; |
From: <sv...@op...> - 2025-06-07 17:27:38
|
Author: manx Date: Sat Jun 7 19:27:26 2025 New Revision: 23406 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23406 Log: Merged revision(s) 23404 from trunk/OpenMPT: [Fix] mpt/fs/fs.hpp: Add missing <shlwapi.h> header. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/src/mpt/fs/fs.hpp Modified: branches/OpenMPT-1.31/src/mpt/fs/fs.hpp ============================================================================== --- branches/OpenMPT-1.31/src/mpt/fs/fs.hpp Sat Jun 7 19:27:07 2025 (r23405) +++ branches/OpenMPT-1.31/src/mpt/fs/fs.hpp Sat Jun 7 19:27:26 2025 (r23406) @@ -15,6 +15,7 @@ #endif // MPT_OS_WINDOWS #if MPT_OS_WINDOWS +#include <shlwapi.h> #include <windows.h> #endif // MPT_OS_WINDOWS |
From: <sv...@op...> - 2025-06-07 17:27:19
|
Author: manx Date: Sat Jun 7 19:27:07 2025 New Revision: 23405 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23405 Log: Merged revision(s) 23404 from trunk/OpenMPT: [Fix] mpt/fs/fs.hpp: Add missing <shlwapi.h> header. ........ Modified: branches/OpenMPT-1.32/ (props changed) branches/OpenMPT-1.32/src/mpt/fs/fs.hpp Modified: branches/OpenMPT-1.32/src/mpt/fs/fs.hpp ============================================================================== --- branches/OpenMPT-1.32/src/mpt/fs/fs.hpp Sat Jun 7 19:26:37 2025 (r23404) +++ branches/OpenMPT-1.32/src/mpt/fs/fs.hpp Sat Jun 7 19:27:07 2025 (r23405) @@ -15,6 +15,7 @@ #endif // MPT_OS_WINDOWS #if MPT_OS_WINDOWS +#include <shlwapi.h> #include <windows.h> #endif // MPT_OS_WINDOWS |
From: <sv...@op...> - 2025-06-07 17:26:48
|
Author: manx Date: Sat Jun 7 19:26:37 2025 New Revision: 23404 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23404 Log: [Fix] mpt/fs/fs.hpp: Add missing <shlwapi.h> header. Modified: trunk/OpenMPT/src/mpt/fs/fs.hpp Modified: trunk/OpenMPT/src/mpt/fs/fs.hpp ============================================================================== --- trunk/OpenMPT/src/mpt/fs/fs.hpp Sat Jun 7 19:10:26 2025 (r23403) +++ trunk/OpenMPT/src/mpt/fs/fs.hpp Sat Jun 7 19:26:37 2025 (r23404) @@ -15,6 +15,7 @@ #endif // MPT_OS_WINDOWS #if MPT_OS_WINDOWS +#include <shlwapi.h> #include <windows.h> #endif // MPT_OS_WINDOWS |
From: <sv...@op...> - 2025-06-07 17:10:33
|
Author: manx Date: Sat Jun 7 19:10:26 2025 New Revision: 23403 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23403 Log: [Fix] mpt/library/library.hpp: Add missing typename. Modified: trunk/OpenMPT/src/mpt/library/library.hpp Modified: trunk/OpenMPT/src/mpt/library/library.hpp ============================================================================== --- trunk/OpenMPT/src/mpt/library/library.hpp Sat Jun 7 19:00:06 2025 (r23402) +++ trunk/OpenMPT/src/mpt/library/library.hpp Sat Jun 7 19:10:26 2025 (r23403) @@ -555,7 +555,7 @@ return f == nullptr; } template <typename... Targs> - auto operator()(Targs &&... args) const -> std::conditional<std::is_same<void, decltype(std::declval<Tfunc *>()(std::forward<Targs>(args)...))>::value, bool, std::optional<decltype(std::declval<Tfunc *>()(std::forward<Targs>(args)...))>>::type { + auto operator()(Targs &&... args) const -> typename std::conditional<std::is_same<void, decltype(std::declval<Tfunc *>()(std::forward<Targs>(args)...))>::value, bool, std::optional<decltype(std::declval<Tfunc *>()(std::forward<Targs>(args)...))>>::type { if constexpr (std::is_same<void, decltype(std::declval<Tfunc *>()(std::forward<Targs>(args)...))>::value) { if (!f) { return false; |
From: <sv...@op...> - 2025-06-07 17:00:12
|
Author: manx Date: Sat Jun 7 19:00:06 2025 New Revision: 23402 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23402 Log: Merged revision(s) 23401 from trunk/OpenMPT: [Fix] WriteMemoryDump: Propagate MiniDumpWriteDump() failure. ........ Modified: branches/OpenMPT-1.32/ (props changed) branches/OpenMPT-1.32/misc/WriteMemoryDump.h Modified: branches/OpenMPT-1.32/misc/WriteMemoryDump.h ============================================================================== --- branches/OpenMPT-1.32/misc/WriteMemoryDump.h Sat Jun 7 18:58:54 2025 (r23401) +++ branches/OpenMPT-1.32/misc/WriteMemoryDump.h Sat Jun 7 19:00:06 2025 (r23402) @@ -50,7 +50,7 @@ ExInfo.ClientPointers = NULL; } - pDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, + BOOL DumpResult = pDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, fullMemDump ? (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithHandleData | MiniDumpWithThreadInfo | MiniDumpWithProcessThreadData | MiniDumpWithFullMemoryInfo #if MPT_COMPILER_MSVC @@ -62,12 +62,12 @@ pExceptionInfo ? &ExInfo : NULL, NULL, NULL); ::CloseHandle(hFile); - result = true; + result = (DumpResult == TRUE); } } ::FreeLibrary(hDll); } - return result; + return result; } OPENMPT_NAMESPACE_END |