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

Fredrik Höglund fredrik at kde.org
Tue Apr 29 22:02:12 BST 2003


On Sunday 27 April 2003 23:53, Adriaan de Groot wrote:
> On Sunday 27 April 2003 18:23, Fredrik Höglund wrote:
[snip]
> > 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?).

I think I'd just add a typedef void (*kde_sighandler_t) (int); to
kcpuinfo.cpp. Since it's a void function with an int parameter on
both systems we won't need a configure check for it.

Do you think this is something that belongs in kdecore/kglobal.h
as well?

Regards,
Fredrik






More information about the kde-core-devel mailing list