Ticket #29 (closed defect)

Opened 10 years ago

Last modified 10 years ago

_MSC_VER==1310 and ssize_t etc.

Reported by: em1 Owned by: gknauf
Priority: normal Milestone:
Component: Version:
Keywords: Cc: em1, gknauf, bagder
Blocked By: Blocks:

Description

The test for _MSC_VER in libssh2.h of 0.15-20070413 is wrong, compilation breaks for _MSC_VER==1310. That version of MSVC++ needs these type definitions:

typedef long ssize_t;
typedef unsigned int uint32_t;
typedef unsigned long long libssh2_uint64_t;
typedef long long libssh2_int64_t;

Change History

comment:1 Changed 10 years ago by bagder

Can you please provide a complete patch that corrects the existing check and adds working code for your version?

comment:2 Changed 10 years ago by em1

Patch submitted (#1745991).

comment:3 Changed 10 years ago by gknauf

I couldnt test with later MSVC versions than 6 when I added the typedefs:
http://libssh2.cvs.sourceforge.net/libssh2/libssh2/include/libssh2.h?view=log#rev1.66

I doubt that the int64 type is gone with _MSC_VER >= 1300;
so I think we can probably simplify the patch like this:

--- libssh2.h.orig Mon Jun 18 20:39:12 2007
+++ libssh2.h Tue Jul 03 12:42:40 2007
@@ -64,13 +64,11 @@

# include <sys/uio.h>
#endif


-#if defined(LIBSSH2_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1300)
+#if defined(LIBSSH2_WIN32) && defined(_MSC_VER) && (_MSC_VER < 1400)

typedef unsigned int64 libssh2_uint64_t;
typedef
int64 libssh2_int64_t;

-#if (_MSC_VER <= 1200)

typedef long ssize_t;
typedef unsigned int uint32_t;

-#endif

#else
typedef unsigned long long libssh2_uint64_t;
typedef long long libssh2_int64_t;

Guenter.

comment:4 Changed 10 years ago by gknauf

this is now fixed in CVS. Please test ands report back. For now I've only changed for _MSC_VER<=1310 since that is what we know for sure. If later versions still need these defines please re-open the bug report.
Thanks!

Note: See TracTickets for help on using tickets.