Subject: Re: Patches for Windows, Wincng, Visual Studio

Re: Patches for Windows, Wincng, Visual Studio

From: Marc Hoersken <info_at_marc-hoersken.de>
Date: Sun, 18 May 2014 13:10:43 +0200

Hello Bob,

thanks again for your patches. I applied slight modifications of the
following patches:

 0001-formal-parameter-must-be-const-since-it-is-used-in-c.patch
 0001-Remove-redundant-inline-define.patch
 0001-Wincng-define-function-prototypes-for-wincng-routine.patch
 0003-in-Windows-a-socket-is-of-type-SOCKET-not-int.patch
 0004-a-1-bit-bit-field-should-be-unsigned-some-compilers-.patch
 0005-openssl-should-not-compile-unless-it-is-specifically.patch

On 08.04.2014 23:36, Bob Kast wrote:
> 0001-Add-Visual-Studio-2013-solution-project-files.patch:
>
> I understand that you are working on a cmake system that will create Visual
> Studio project files. Until that time, I have a patch that includes project
> files for VS2013. It can be something temporary or it can be something used
> as a model for creating the cmake files.

I am holding back the following patches until we figured out an approach
to generate Visual Studio project files:

 0001-Add-Visual-Studio-2013-solution-project-files.patch
 0001-for-MS-VS-builds-specify-the-libraries-that-are-requ.patch

My preference would be something like the Visual Studio files and
generation scripts Steve Holme did for curl.
See the following mailinglist posts to the curl-library mailinglist for
more information:

 http://curl.haxx.se/mail/lib-2014-04/0059.html
 http://thread.gmane.org/gmane.comp.web.curl.library/42126 (complete thread)

> 0001-Use-secure-versions-of-CRT-library.patch:
>
> Libssh2 uses deprecated versions of the run-time library. This patch updates
> that so they use the secure versions. For my changes to correctly compile on
> non-Windows systems, you need to add the following defines. I was not sure
> where these should be added:
>
> #define SNPRINTF snprintf
> #define VSNPRINTF vsnprintf

I think we need more feedback/information regarding the following
patches before they can be merged:

 0001-Use-secure-versions-of-CRT-library.patch
  I agree that libssh2 should use the secure string formatting functions
if they are available.
  I am just not sure if macros and various ifdefs are the best approach.
  Maybe we can create internal snprintf and vsnprintf wrapper functions
instead?
  Like curlx: https://github.com/bagder/curl/blob/master/lib/curlx.h

 0001-Windows-library-don-t-export-externals.patch
  I checked the generated libssh2-1.dll and there were no exports
besides the libssh2 API functions.
  Why do you think this patch is necessary and to which build scenario
does it apply?

 0001-Windows-Tracing-use-OutputDebugString.patch
  It's definitely a good idea to use OutputDebugString instead of
fprintf, but maybe there
  should be a separate define for that instead of using the following:
   "#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)"

Would you mind to elaborate a little bit on the changes and adapt the
code style to the existing libssh2 code?

Thanks in advance.

Best regards,
Marc
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2014-05-18