Build failure on uclibc due to locale issues
I'm seeing this build failure in our autobuilders as of pipewire 0.3.50
/0.3.51
, guessing some of the locale support should be guarded with a feature check.
../spa/include/spa/utils/string.h: In function 'spa_strtof':
../spa/include/spa/utils/string.h:278:9: error: unknown type name 'locale_t'
278 | static locale_t locale = NULL;
| ^~~~~~~~
../spa/include/spa/utils/string.h:278:27: warning: initialization of 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
278 | static locale_t locale = NULL;
| ^~~~
../spa/include/spa/utils/string.h:279:2: error: unknown type name 'locale_t'
279 | locale_t prev;
| ^~~~~~~~
In file included from ../spa/include/spa/pod/pod.h:32,
from ../spa/include/spa/pod/iter.h:35,
from ../spa/include/spa/pod/parser.h:35,
from ../spa/include/spa/param/audio/format-utils.h:37,
from ../spa/plugins/audioconvert/channelmix-ops.c:29:
../spa/include/spa/utils/string.h:281:26: warning: comparison between pointer and integer
281 | if (SPA_UNLIKELY(locale == NULL))
| ^~
../spa/include/spa/utils/defs.h:244:46: note: in definition of macro 'SPA_UNLIKELY'
244 | #define SPA_UNLIKELY(x) (__builtin_expect(!!(x),0))
| ^
In file included from ../spa/plugins/audioconvert/channelmix-ops.h:29,
from ../spa/plugins/audioconvert/channelmix-ops.c:37:
../spa/include/spa/utils/string.h:282:12: warning: implicit declaration of function 'newlocale'; did you mean 'setlocale'? [-Wimplicit-function-declaration]
282 | locale = newlocale(LC_ALL_MASK, "C", NULL);
| ^~~~~~~~~
| setlocale
../spa/include/spa/utils/string.h:282:22: error: 'LC_ALL_MASK' undeclared (first use in this function)
282 | locale = newlocale(LC_ALL_MASK, "C", NULL);
| ^~~~~~~~~~~
../spa/include/spa/utils/string.h:282:22: note: each undeclared identifier is reported only once for each function it appears in
../spa/include/spa/utils/string.h:283:9: warning: implicit declaration of function 'uselocale'; did you mean 'setlocale'? [-Wimplicit-function-declaration]
283 | prev = uselocale(locale);
| ^~~~~~~~~
| setlocale
../spa/include/spa/utils/string.h: In function 'spa_strtod':
../spa/include/spa/utils/string.h:322:9: error: unknown type name 'locale_t'
322 | static locale_t locale = NULL;
| ^~~~~~~~
../spa/include/spa/utils/string.h:322:27: warning: initialization of 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
322 | static locale_t locale = NULL;
| ^~~~
../spa/include/spa/utils/string.h:323:2: error: unknown type name 'locale_t'
323 | locale_t prev;
| ^~~~~~~~
In file included from ../spa/include/spa/pod/pod.h:32,
from ../spa/include/spa/pod/iter.h:35,
from ../spa/include/spa/pod/parser.h:35,
from ../spa/include/spa/param/audio/format-utils.h:37,
from ../spa/plugins/audioconvert/channelmix-ops.c:29:
../spa/include/spa/utils/string.h:325:26: warning: comparison between pointer and integer
325 | if (SPA_UNLIKELY(locale == NULL))
| ^~
../spa/include/spa/utils/defs.h:244:46: note: in definition of macro 'SPA_UNLIKELY'
244 | #define SPA_UNLIKELY(x) (__builtin_expect(!!(x),0))
| ^
In file included from ../spa/plugins/audioconvert/channelmix-ops.h:29,
from ../spa/plugins/audioconvert/channelmix-ops.c:37:
../spa/include/spa/utils/string.h:326:22: error: 'LC_ALL_MASK' undeclared (first use in this function)
326 | locale = newlocale(LC_ALL_MASK, "C", NULL);
| ^~~~~~~~~~~