* [PATCH] alsa-lib: Add sys/types.h to include list
@ 2013-02-12 9:06 David Henningsson
2013-02-12 9:10 ` Takashi Iwai
2013-02-12 9:21 ` Tanu Kaskinen
0 siblings, 2 replies; 5+ messages in thread
From: David Henningsson @ 2013-02-12 9:06 UTC (permalink / raw)
To: tiwai, alsa-devel; +Cc: David Henningsson, 1109298
This is needed by snd_pcm_format_silence* functions which
return u_int*_t. It was discovered while trying to compile ALSA
programs with eglibc 2.17.
Credits to Richard Shaw, Gary Buhrmaster, Matthieu Baerts and
Adam Conrad for this fix.
BugLink: https://bugs.launchpad.net/bugs/1109298
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=885306
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
include/asoundlib-head.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/asoundlib-head.h b/include/asoundlib-head.h
index 20c8a68..6edbab0 100644
--- a/include/asoundlib-head.h
+++ b/include/asoundlib-head.h
@@ -31,6 +31,7 @@
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
#include <string.h>
#include <fcntl.h>
#include <assert.h>
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] alsa-lib: Add sys/types.h to include list
2013-02-12 9:06 [PATCH] alsa-lib: Add sys/types.h to include list David Henningsson
@ 2013-02-12 9:10 ` Takashi Iwai
2013-02-12 9:16 ` David Henningsson
2013-02-12 9:21 ` Tanu Kaskinen
1 sibling, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2013-02-12 9:10 UTC (permalink / raw)
To: David Henningsson; +Cc: alsa-devel, 1109298
At Tue, 12 Feb 2013 10:06:11 +0100,
David Henningsson wrote:
>
> This is needed by snd_pcm_format_silence* functions which
> return u_int*_t. It was discovered while trying to compile ALSA
> programs with eglibc 2.17.
>
> Credits to Richard Shaw, Gary Buhrmaster, Matthieu Baerts and
> Adam Conrad for this fix.
>
> BugLink: https://bugs.launchpad.net/bugs/1109298
> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=885306
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
For u_int_* types, wouldn't it better to include stdint.h?
Takashi
> ---
> include/asoundlib-head.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/asoundlib-head.h b/include/asoundlib-head.h
> index 20c8a68..6edbab0 100644
> --- a/include/asoundlib-head.h
> +++ b/include/asoundlib-head.h
> @@ -31,6 +31,7 @@
> #include <unistd.h>
> #include <stdio.h>
> #include <stdlib.h>
> +#include <sys/types.h>
> #include <string.h>
> #include <fcntl.h>
> #include <assert.h>
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] alsa-lib: Add sys/types.h to include list
2013-02-12 9:10 ` Takashi Iwai
@ 2013-02-12 9:16 ` David Henningsson
2013-02-12 9:21 ` Takashi Iwai
0 siblings, 1 reply; 5+ messages in thread
From: David Henningsson @ 2013-02-12 9:16 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, 1109298
On 02/12/2013 10:10 AM, Takashi Iwai wrote:
> At Tue, 12 Feb 2013 10:06:11 +0100,
> David Henningsson wrote:
>>
>> This is needed by snd_pcm_format_silence* functions which
>> return u_int*_t. It was discovered while trying to compile ALSA
>> programs with eglibc 2.17.
>>
>> Credits to Richard Shaw, Gary Buhrmaster, Matthieu Baerts and
>> Adam Conrad for this fix.
>>
>> BugLink: https://bugs.launchpad.net/bugs/1109298
>> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=885306
>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>
> For u_int_* types, wouldn't it better to include stdint.h?
Hmm, it looks like stdint.h declares uint_* whereas sys/types.h declares
u_int_* (notice the _ between "u" and "int"). Do you think we should
change snd_pcm_format_silence* from u_int to uint?
>
>
> Takashi
>
>> ---
>> include/asoundlib-head.h | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/include/asoundlib-head.h b/include/asoundlib-head.h
>> index 20c8a68..6edbab0 100644
>> --- a/include/asoundlib-head.h
>> +++ b/include/asoundlib-head.h
>> @@ -31,6 +31,7 @@
>> #include <unistd.h>
>> #include <stdio.h>
>> #include <stdlib.h>
>> +#include <sys/types.h>
>> #include <string.h>
>> #include <fcntl.h>
>> #include <assert.h>
>> --
>> 1.7.9.5
>>
>
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] alsa-lib: Add sys/types.h to include list
2013-02-12 9:06 [PATCH] alsa-lib: Add sys/types.h to include list David Henningsson
2013-02-12 9:10 ` Takashi Iwai
@ 2013-02-12 9:21 ` Tanu Kaskinen
1 sibling, 0 replies; 5+ messages in thread
From: Tanu Kaskinen @ 2013-02-12 9:21 UTC (permalink / raw)
To: David Henningsson; +Cc: tiwai, alsa-devel, 1109298
On Tue, 2013-02-12 at 10:06 +0100, David Henningsson wrote:
> This is needed by snd_pcm_format_silence* functions which
> return u_int*_t. It was discovered while trying to compile ALSA
> programs with eglibc 2.17.
>
> Credits to Richard Shaw, Gary Buhrmaster, Matthieu Baerts and
> Adam Conrad for this fix.
>
> BugLink: https://bugs.launchpad.net/bugs/1109298
> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=885306
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> ---
> include/asoundlib-head.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/asoundlib-head.h b/include/asoundlib-head.h
> index 20c8a68..6edbab0 100644
> --- a/include/asoundlib-head.h
> +++ b/include/asoundlib-head.h
> @@ -31,6 +31,7 @@
> #include <unistd.h>
> #include <stdio.h>
> #include <stdlib.h>
> +#include <sys/types.h>
int*_t and uint*_t (not u_int*_t) are standard in C99, and they are
available in stdint.h or inttypes.h (both work, inttypes.h contains also
the PRI* constants for the corresponding printf() format specifiers).
Perhaps it would be better to use one of those headers instead? That
would require converting u_int*_t usage to uint*_t, though, so it would
take some extra work...
--
Tanu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] alsa-lib: Add sys/types.h to include list
2013-02-12 9:16 ` David Henningsson
@ 2013-02-12 9:21 ` Takashi Iwai
0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2013-02-12 9:21 UTC (permalink / raw)
To: David Henningsson; +Cc: alsa-devel, 1109298
At Tue, 12 Feb 2013 10:16:13 +0100,
David Henningsson wrote:
>
> On 02/12/2013 10:10 AM, Takashi Iwai wrote:
> > At Tue, 12 Feb 2013 10:06:11 +0100,
> > David Henningsson wrote:
> >>
> >> This is needed by snd_pcm_format_silence* functions which
> >> return u_int*_t. It was discovered while trying to compile ALSA
> >> programs with eglibc 2.17.
> >>
> >> Credits to Richard Shaw, Gary Buhrmaster, Matthieu Baerts and
> >> Adam Conrad for this fix.
> >>
> >> BugLink: https://bugs.launchpad.net/bugs/1109298
> >> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=885306
> >> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> >
> > For u_int_* types, wouldn't it better to include stdint.h?
>
> Hmm, it looks like stdint.h declares uint_* whereas sys/types.h declares
> u_int_* (notice the _ between "u" and "int"). Do you think we should
> change snd_pcm_format_silence* from u_int to uint?
Ah, OK, then sys/types.h is the right inclusion.
Maybe conversion to uint_*_t would be more universal, but I don't
think it's worth, as these types are used in many places in the public
API already.
I'll take your patch as is now.
thanks,
Takashi
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-02-12 9:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-12 9:06 [PATCH] alsa-lib: Add sys/types.h to include list David Henningsson
2013-02-12 9:10 ` Takashi Iwai
2013-02-12 9:16 ` David Henningsson
2013-02-12 9:21 ` Takashi Iwai
2013-02-12 9:21 ` Tanu Kaskinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).