[alsa-devel] question about alsa-lib commit 8c9e4114 (Add struct timeval and timespec definition when _POSIX_C_SOURCE is not defined)

John Spencer maillist-alsa at barfooze.de
Wed Jul 24 03:10:11 CEST 2013


the commit 
http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=8c9e4114a23aad96b4b9570624a4fd96745dfe01

was added in 2006 with a FIXME hint that it could cause a build error.
this is exactly what happens when using the header with musl libc to 
build software depending on alsa-lib (for example "sweep").

may i ask what for this hack was added ? i suspect it's for supporting 
some ancient version of glibc that didnt define those structs.
in that case something like

#if defined(__GLIBC__) && (__GLIBC__ < 2)

would probably make more sense.
i could even imagine that the target for the hack is no longer supported 
anyway, so i think it could simply be removed.

the problematic part is that it's the job of the *application* to 
request the POSIX namespace, not the job of the libc.

since sweep's build environment does not set _POSIX_SOURCE, the code 
gets activated and causes a conflict.

--JS

p.s.
thanks for applying the signal.h patch!


More information about the Alsa-devel mailing list