Subject: Re: example/direct_tcpip.c missing header

Re: example/direct_tcpip.c missing header

From: Guenter <lists_at_gknw.net>
Date: Wed, 02 Jun 2010 11:57:12 +0200

Hi Peter,
Am 02.06.2010 08:53, schrieb Peter Stuge:
> direct_tcpip.c builds for Windows and Linux. I would very much
> appreciate to hear if it builds also on other platforms that people
> have access to.
fine - then we probably need to write in the head: "Builds on Peter
Stuge's Linux and Windoze box", and exclude from our samples which are
build by default.
I can absolutely not agree with what you talk about. We need in *any*
case more ifdefs for headers the more platforms folks want to build the
sample on. What do you want to say? That it is enough when the sample
builds on your platform, and anybody on any other platform has to adopt
for his one -- although we can do far better?
Look, if I want to build this sample for NetWare I need to include
sys/select.h because fd_set is defined there; I bet that there are other
platfroms with similar needs, f.e. AIX, etc.
Its no problem that I add now:
#ifdef NETWARE
#include <sys/select.h>
#endif
which would be same manner as what you did already for Windoze. Tomorrow
comes John Doe and says that he needs this header too, so we have to change:
#if defined(NETWARE) || defined(AIX)
#include <sys/select.h>
#endif
and so on -- so where end we then? With an ugly list of
platform-specific ifdefs. The way we do it with the other samples is
perfectly ok: we have a clean ifdef for each header, and we pull the
info which one to use from libssh2_config.h. Anything else finally after
some time ends up more ugly than this approach.

BTW. I would also like to see a short description in the head of the
sample like we have with those other samples too.

GŁn.

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-06-02