Bug 90285

Summary: #include <xlocale.h> is missing in src/pulsecore/core-util.c on FreeBSD
Product: PulseAudio Reporter: Ting-Wei Lan <lantw44>
Component: coreAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: Other   
OS: FreeBSD   
Whiteboard:
i915 platform: i915 features:
Attachments: Include xlocale.h only if __FreeBSD__ defined
Include xlocale.h only if existing

Description Ting-Wei Lan 2015-05-02 17:36:30 UTC
FreeBSD supports strtod_l, but using it requires #include <xlocale.h>. We have to add the missing include to the HAVE_STRTOF_L block to prevent implicit declaration.

This problem is reported by a FreeBSD user on a mailing list:
http://lists.freebsd.org/pipermail/freebsd-gnome/2015-April/032138.html

A patch is also attached in the mailing list post:
http://lists.freebsd.org/pipermail/freebsd-gnome/attachments/20150424/353a704b/attachment.c
Comment 1 Tanu Kaskinen 2015-05-20 19:37:33 UTC
Thanks for reporting. I sent Jakob's patch to the mailing list (with a related cleanup patch): http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23571
Comment 2 Ting-Wei Lan 2015-06-19 06:37:58 UTC
This patch still doesn't get reviewed after it was posted more than one month ago ...
Comment 3 Ting-Wei Lan 2015-09-05 15:17:03 UTC
I really hope this patch can be accepted. We have waited for 4 months for this trivial include fix.
Comment 4 David Henningsson 2015-09-07 13:01:52 UTC
Tanu's both patches pushed to master now.
Comment 5 Andreas Reis 2015-09-30 18:19:18 UTC
Breaks compiling with musl as standard library, which has strtod_l but no xlocale.h.
Comment 6 Tanu Kaskinen 2015-10-01 05:47:52 UTC
Can you make a patch?
Comment 7 Andreas Reis 2015-10-02 18:27:40 UTC
Created attachment 118635 [details] [review]
Include xlocale.h only if __FreeBSD__ defined

This should do: Musl doesn't come with a macro to identify itself, so check for the one FreeBSD offers.
Comment 8 Ting-Wei Lan 2015-10-02 18:39:34 UTC
(In reply to Andreas Reis from comment #7)
> Created attachment 118635 [details] [review] [review]
> Include xlocale.h only if __FreeBSD__ defined
> 
> This should do: Musl doesn't come with a macro to identify itself, so check
> for the one FreeBSD offers.

Can you add a check for xlocale.h in configure.ac instead? xlocale.h is not a FreeBSD-specific header.
Comment 9 Andreas Reis 2015-10-03 11:35:26 UTC
Created attachment 118644 [details] [review]
Include xlocale.h only if existing
Comment 10 Ting-Wei Lan 2015-10-04 18:31:08 UTC
Attachment 118644 [details] works fine on FreeBSD.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.