[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libssh and Visual C++ (again)


I suggest the included patch
It creates a new data type "ssh_ssize_t" which equals ssize_t when this
type exists, and is the signed integer with the same bit count as size_t
when ssize_t is not defined.
I tested it under Linux 64 bits, Windows 32 bits and Windows 64 bits

Christophe

2012/9/25 Werner Koch <wk@xxxxxxxxx>

> On Mon, 24 Sep 2012 10:11, asn@xxxxxxxxxxxxxx said:
>
> > Ok, then we should probably use
> >
> > typedef uint64_t ssh_ssize_t;
>
> IMHO, the best way to handle system dependent definition is to provide a
> header file customized for the system.  Thus at build time you don't use
> and install the header you distribute with the source but one which
> matches the system's requirement.  For example on GNU systems you may
> simply
>
>  #include <unistd.h>
>
> but on Windows you install a header with the line:
>
>  typedef int ssize_t;
>
> (or whatever the particular Windows system requires).  Because sometimes
> users simply throw in any header file they found somewhere, I often add
> a configure check to see whether the header matches the expected one
> (e.g. using the CPU-OS-VENDOR string)
>
> Adding your own type merely shifts the responsibility from you to the
> user ;-)
>
>
>
> Salam-Shalom,
>
>    Werner
>
>
> --
> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>
>
>

Attachment: 0003-provide-fallback-definition-of-ssize_t.patch
Description: Binary data


Follow-Ups:
Re: libssh and Visual C++ (again)Christophe Baribaud <christophe.baribaud@xxxxxxxxx>
References:
libssh and Visual C++ (again)Christophe Baribaud <christophe.baribaud@xxxxxxxxx>
Re: libssh and Visual C++ (again)Andreas Schneider <asn@xxxxxxxxxxxxxx>
Re: libssh and Visual C++ (again)Christophe Baribaud <christophe.baribaud@xxxxxxxxx>
Re: libssh and Visual C++ (again)Andreas Schneider <asn@xxxxxxxxxxxxxx>
Re: libssh and Visual C++ (again)Werner Koch <wk@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org