[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#656947: __size_t issue affecting soundcard.h remains



Hi,

On 28/01/12 03:35, Steven Chamberlain wrote:
> $ g++-4.6 /usr/include/sys/soundcard.h
> In file included from /usr/include/machine/_types.h:8:0,
>                  from /usr/include/sys/_types.h:33,
>                  from /usr/include/machine-i386/endian.h:37,
>                  from /usr/include/machine/endian.h:8,
>                  from /usr/include/sys/soundcard.h:110:
> /usr/include/machine-i386/_types.h:94:9: error: declaration does not
> declare anything [-fpermissive]

> $ g++ /usr/include/sys/soundcard.h -E | grep segsz -C 2
> typedef __int32_t __ptrdiff_t;
> typedef __int32_t __register_t;
> typedef __int32_t __segsz_t;
> typedef __uint32_t ;
> typedef __int32_t __ssize_t;

Found it!

I did 'cpp -dD /usr/include/sys/soundcard.h' which led me to this:

/usr/lib/gcc/i486-kfreebsd-gnu/4.6/include/stddef.h:
> 203 #if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
> 204 /* __size_t is a typedef on FreeBSD 5!, must not trash it. */
> 205 #else
> 206 #define __size_t
> 207 #endif

Not sure of the right way to fix it so I've CC'd the Debian GCC Maintainers.

Maybe just like this?  It fixes the issue for me.

--- stddef.h.orig	2012-01-28 04:13:06.000000000 +0000
+++ stddef.h	2012-01-28 04:14:05.000000000 +0000
@@ -200,7 +200,7 @@
 #define ___int_size_t_h
 #define _GCC_SIZE_T
 #define _SIZET_
-#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
+#if defined (__FreeBSD__) && (__FreeBSD__ >= 5) || (__FreeBSD_kernel__)
 /* __size_t is a typedef on FreeBSD 5!, must not trash it. */
 #else
 #define __size_t


While here, I noticed similar stuff in the same file and wondered if it
may have been causing other problems on kFreeBSD, such as:

> /* On FreeBSD 5, machine/ansi.h does not exist anymore... */
> #if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
> #include <sys/_types.h>
> #endif

Thanks,
Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org


Reply to: