www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: RE: Suggested patches for WinCNG

RE: Suggested patches for WinCNG

From: Bob Kast <bob_2824_at_hotmail.com>
Date: Thu, 20 Mar 2014 14:29:26 -0400

> > Libssh2_priv.h:
> >
> > Redundant #define inline
> >
> It might be there for a reason. Please do not forget that there are other
> Windows-compilers except Visual Studio. For example, I use MinGW and
> MinGW-w64 to compile libssh2. It might be worth to add an #ifndef around
> the #define in that case.

Just above it is the exact same define, enclosed in #ifdef WIN32. I thought any Win compiler would define that. In any case, not important.

> > Wincng.c:
> >
> > Putting the #pragma for the libraries works for both DLL and LIB versions.
> >
> This is rather compiler-specific to Visual Studio than platform-specific. The
> #ifdef WIN32 ist not sufficient in that case, since MinGW gcc compilers won't
> understand the pragma statements. I would rather suggest adding the
> libraries to the AdditionalDependencies element of the Link section within
> your Visual Studio project files.

It is really preferable to do it here instead of the project file. For the LIB build, there is no linker so there is no place in the project file to put it. You'd need to add these libs to all OTHER projects that may include this library. I can certainly add beef up the #if so it only includes VS.

> > _libssh2_wincng_hash_update: the parameter needs to be const to match.
> > It is interesting that C just gives a warning for that.
> >
> But is casting from (const unsigned char *) to (unsigned char *) actually a real
> fix for this or just hiding things?

Unfortunately, there is no choice, besides making a copy of the data (which is definitely not worth it). It looks like the prototype for BCryptHashData() is incorrect in NOT labelling the pbInput parameter as const. Luckily, const issues in C are pretty easily overcome with a regular cast.

> I think we should rather wait for Alexander Lamaison's CMake files since they
> will allow us to create generic VS project files that are not tied to a specific VS
> and SDK version. For example, I still use VS 2012 for my own projects.

I'm assuming that it will create makefiles, not VS project files, correct?

libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2014-03-20

the libssh2 team