kdelibs/kdefx/kcpuinfo.cpp (1.2) broken?

Adriaan de Groot adridg at cs.kun.nl
Sun Apr 27 22:53:16 BST 2003


On Sunday 27 April 2003 18:23, Fredrik Höglund wrote:
> On Sunday 27 April 2003 04:38, Brian Ledbetter wrote:
> > Of course, if this works for y'all, it may just be an issue with my
> > compiler.  Here's my info:
> >
> > $ uname -a
> > FreeBSD tokyo.home.shadowcom.net 5.0-RELEASE-p6 FreeBSD 5.0-RELEASE-p6
> > #2: Fri Mar 28 22:16:47 EST 2003
> > root at newbie.home.shadowcom.net:/usr/src/sys/i386/compile/TOKYO  i386 $
> > gcc --version
> > gcc (GCC) 3.2.1 [FreeBSD] 20021119 (release)
>
> With that change it doesn't compile for me with gcc 3.2.3, but to me
> it looks more like a libc issue than a compiler issue.
>
> How is __sighandler_t declared in your signal.h?
> In glibc 2.3.1 it's declared as typedef void (*__sighandler_t) (int);

We have

/usr/include/sys/signal.h:typedef void __sighandler_t __P((int));

which preprocessor magic resolves to

eggs.ebn.kun.nl$gcc -E t.c | grep __sighandler_t
typedef void __sighandler_t  (int)  ;
typedef __sighandler_t  *sig_t;

So this is a glibc vs. BSD libc issue. Ugh. Two solutions present themself:

#ifdef QT_OS_BSD
#define SIGFUNC sig_t;
#else
#define SIGFUNC __sighandler_t;
#endif

or doing a configure check for the type of ::signal() and using some 
KDE-defined type for that (isn't there one already, like (we once had ?) 
kde_size_t?).

-- 
pub  1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <groot at kde.org>
     Key fingerprint = 934E 31AA 80A7 723F 54F9  50ED 76AC EE01 FEA2 A3FE




More information about the kde-core-devel mailing list