Subject: [libssh2] LIBSSH2_WIN32

[libssh2] LIBSSH2_WIN32

From: Gisle Vanem <>
Date: Wed, 15 Nov 2006 06:13:35 +0100

Hi all, this is my 1st post.

What is the purpose of using this define? I mean, normally
any Windows compiler/target is identified with WIN32 or _WIN32.
Both are built-in in MingW, but MSVC only has _WIN32. Lets go
with _WIN32 only.

Compiling with LIBSSH2_WIN32 in MingW stopped at this horrid
statement (in libssh2.h):

#if defined(LIBSSH2_DARWIN) || (defined(LIBSSH2_WIN32) && !defined(_MSC_VER))
# include <sys/uio.h>

I think it would be better to include that file for targets known to have it.
Not the other way around. Like:

#if defined(LIBSSH2_DARWIN) || defined(__CYGWIN__)

BTW. The statement:

  #if defined(LIBSSH2_WIN32) && _MSC_VER < 1300
  typedef unsigned __int64 libssh2_uint64_t;

seems to blindly assume MSVC is the only target on Win32. Should be
changed into:

  #if defined(LIBSSH2_WIN32) && (defined(_MSC_VER) && _MSC_VER < 1300)
  typedef unsigned __int64 libssh2_uint64_t;


Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
libssh2-devel mailing list
Received on 2006-11-15