Subject: Re: [libssh2] need some more small patches for Win32 platform

Re: [libssh2] need some more small patches for Win32 platform

From: Guenter Knauf <eflash_at_gmx.net>
Date: Tue, 10 Apr 2007 18:42:11 +0200

Hi all,
I've just looked into the MingW32 and MSVC6 builds, and need some more patches which I explain below:

> block sys/ioctl.h for NetWare because it brings in unistd.h which then
> clahes with encrypt() in ctypt.c.
> http://www.gknw.net/test/libssh2/libssh2_priv.h.diff

> I think its a bad thing to have a function encrypt() defined in
> ./src/crypt.c although this function is already defined in most OSes; that
> should really be renamed to libssh2_encrypt() because its only a matter
> which OS header gets included and this will clash sooner or later for
> other platforms too.

http://www.gknw.net/test/libssh2/libssh2_priv.h.diff
I've updated this patch because Win32 doesnt have sys/ioctl.h; also changed to proper configure defines rather than platform identifiers.

http://www.gknw.net/test/libssh2/channel.c.diff
changed to proper configure defines rather than platform identifiers.

http://www.gknw.net/test/libssh2/misc.c.diff
again I'd suggest here to rename the encrypt() function to libssh2_encrypt() so that we can probably handle the unistd.h inclusion commonly in libssh2_priv.h

http://www.gknw.net/test/libssh2/packet.c.diff
changed to proper configure defines rather than platform identifiers.

http://www.gknw.net/test/libssh2/session.c.diff
Win32 has no ENOTCONN - I checked MSVC6, MingW32, Borland C++ 5.5, OpenWatcom 1.6; all have this define in winsock2.h but blocked with '#if 0', but a comment that the WSA* defines should be used instead, and that's what my patch does.
also changed to proper configure defines rather than platform identifiers.

http://www.gknw.net/test/libssh2/transport.c.diff
fixed a wrong type.

http://www.gknw.net/test/libssh2/win32__libssh2_config.h.diff
added the new defines for inclusion of headers; removed ENOTCONN define, added HAVE_IOCTLSOCKET define.

http://www.gknw.net/test/libssh2/Makefile.netware.diff
updated Makefile.netware to add more exports; fixed linking.

http://www.gknw.net/test/libssh2/Makefile.win32.diff
updated OpenSSL version to have users use latest; removed HAVE_IOCTLSOCKET define.

http://www.gknw.net/test/libssh2/libssh2.h.diff
added two more typedefs but blocked them so they are only used with MSVC6 or lower (dont know if later MSVC versions still need them).

http://www.gknw.net/test/libssh2/libssh2_sftp.h.diff
changed to proper configure defines rather than platform identifiers.

http://www.gknw.net/test/libssh2/configure.in.diff
test for additional headers to bring the new defines into libssh2_config.h.

http://www.gknw.net/test/libssh2/example_simple__Makefile.am.diff
add the ./src dir to the includes so that libssh2_config.h can be included from libssh2_sftp.h.

Here you can find a complete diff which you can apply in one go:
http://www.gknw.net/test/libssh2/libssh2-cvs-20070410.diff

tested:
for NetWare platform with gcc and Metrowerks CodeWarrior,
for Win32 platform with MingW32 and MSVC6,
for Linux platform on SuSE 10.0 with gcc 4.0.2.

hopefully I didnt miss something, but due to the various touched files that may happen - its more work to create the diffs, and transfer between the platforms rather than creating the patches itself.

thanks, Guenter.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-04-10