Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

defining madness

0 views
Skip to first unread message

Nick Thompson

unread,
Jun 22, 2001, 11:40:21 AM6/22/01
to
<rant>

I'm feeling incredulous after my latest attempt to build KDE from CVS on
Solaris. Now that Sun have finally fixed the X header files so that they
conform to ANSI C standards, they seem to have slipped in a mind
boggling piece of code to make life difficult. In sys/socket.h, they
have:

#define connect __xnet_connect

This is because the socket 'connect' function is really called
'__xnet_connect' (there are others like this too). But in KDE, in many
places and quite legally, a method called connect is defined/used to
connect slots to signals. If socket.h is not included, then this works
as expected, but if socket.h is included, the C preprocessor replaces
EVERY occurrence of a connect string with __xnet_connect!!! Ahggg.
Surely this is a brain dead idea?! Certainly it means I can no longer
build KDE. The best work around I've been able to come up with is:

file mysocket.h:
#include <sys/socket.h>
#undef connect
static int (*connect)(int, const sockaddr*, unsigned
int)=__xnet_connect;

...but this creates an instance of the variable connect in every file
that uses socket.h. How about:

#include <sys/socket.h>
#undef connect
static int connect(int a, const sockaddr* b, unsigned int c) {return
xnet_connect(a, b, c);}

...and hope the optimizer sorts of the inefficiency of adding a wrapper.

Has anybody else come across this or got any suggestions?

</rant>,
Nick.

--
Send posts to: k...@lists.netcentral.net
Send all commands to: kde-r...@lists.netcentral.net
Put your command in the SUBJECT of the message:
"subscribe", "unsubscribe", "set digest on", or "set digest off"
PLEASE READ THE ARCHIVED MESSAGES AT http://lists.kde.org/ BEFORE POSTING
**********************************************************************
This list is from your pals at NetCentral <http://www.netcentral.com/>

Rick Sivernell

unread,
Jun 22, 2001, 4:43:55 PM6/22/01
to

Nick

Which Solaris IA86 or sun. I have IA Solaris 8 and would like to put kde2
on it. If you have a successfull install you might want to write a step x
step for it and put it on the caldera users list.
--
Rick Sivernell
Dallas, Texas 75287
972 306-2296
res0...@gte.net
Registered Linux User

        .~.
       / v \
      /( _ )\
        ^ ^
In Linux we trust!

0 new messages