OK, I introduced the additional wrapper now with svn commit 4743 on svn://scm.orgis.org/mpg123 .
You can test by using current https://mpg123.org/snapshot or by applying the attached patch. Test reports before I release (this weekend?) are welcome. Alrighty then, Thomas
Index: NEWS =================================================================== --- NEWS (revisión: 4742) +++ NEWS (revisión: 4743) @@ -10,6 +10,8 @@ - More CMake build fixes thanks to David Callu (bug 290). - Use PROG_LIBS for output modules, to reinstate not necessarily proper but previous behaviour and fix FreeBSD port build (bug 291). +- Refine LFS support in libsyn123, avoiding architecture-dependent syn123.h + (debian bug 963205). 1.26.1 ------ Index: src/libsyn123/resample.c =================================================================== --- src/libsyn123/resample.c (revisión: 4742) +++ src/libsyn123/resample.c (revisión: 4743) @@ -1899,15 +1899,25 @@ return (tot <= INT64_MAX) ? (int64_t)tot : SYN123_OVERFLOW; } -#if SIZEOF_LONG == 4 -long attribute_align_arg -syn123_resample_total_32(long inrate, long outrate, long ins) +int32_t attribute_align_arg +syn123_resample_total_32(int32_t inrate, int32_t outrate, int32_t ins) { int64_t tot = syn123_resample_total_64(inrate, outrate, ins); - return (tot <= LONG_MAX) ? (long)tot : SYN123_OVERFLOW; + return (tot <= INT32_MAX) ? (int32_t)tot : SYN123_OVERFLOW; } + +lfs_alias_t syn123_resample_total(long inrate, long outrate, lfs_alias_t ins) +{ +#if LFS_ALIAS_BITS+0 == 64 + return syn123_resample_total_64(inrate, outrate, ins); +#elif LFS_ALIAS_BITS+0 == 32 + return syn123_resample_total_32(inrate, outrate, ins); +#else + #error "Unexpected LFS_ALIAS_BITS value." #endif +} + // The inverse function: How many input samples are needed to get at least // the desired amount of output? int64_t attribute_align_arg @@ -1959,17 +1969,24 @@ return (tot <= INT64_MAX) ? (int64_t)tot : SYN123_OVERFLOW; } -#if SIZEOF_LONG == 4 -long attribute_align_arg -syn123_resample_intotal_32(long inrate, long outrate, long outs) +int32_t attribute_align_arg +syn123_resample_intotal_32(int32_t inrate, int32_t outrate, int32_t outs) { int64_t tot = syn123_resample_intotal_64(inrate, outrate, outs); - return (tot <= LONG_MAX) ? (long)tot : SYN123_OVERFLOW; + return (tot <= INT32_MAX) ? (int32_t)tot : SYN123_OVERFLOW; } + +lfs_alias_t syn123_resample_intotal(long inrate, long outrate, lfs_alias_t outs) +{ +#if LFS_ALIAS_BITS+0 == 64 + return syn123_resample_intotal_64(inrate, outrate, outs); +#elif LFS_ALIAS_BITS+0 == 32 + return syn123_resample_intotal_32(inrate, outrate, outs); +#else + #error "Unexpected LFS_ALIAS_BITS value." #endif +} -#define syn123_resample_total syn123_resample_total_64 - // As any sensible return value is at least 1, this uses the unsigned // type and 0 for error/pathological input. // This function could be simplified to Index: src/libsyn123/syn123.h.in =================================================================== --- src/libsyn123/syn123.h.in (revisión: 4742) +++ src/libsyn123/syn123.h.in (revisión: 4743) @@ -977,9 +977,6 @@ # else # error "Unpredicted _FILE_OFFSET_BITS value." # endif -#else -# define syn123_resample_total syn123_resample_total_@LFS_ALIAS_BITS@ -# define syn123_resample_intotal syn123_resample_intotal_@LFS_ALIAS_BITS@ #endif /** Give exact output sample count for total input sample count.