1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-07 08:02:56 +03:00

VMS can't use %zd for off_t format.

%z is a C99-ism that VMS doesn't currently have; even though the
compiler is C99-compliant, the library isn't quite.  The off_t used
for the st_size element of the stat can be 32-bit or 64-bit, so
detect what we've got and pick a format accordingly.
This commit is contained in:
Craig A. Berry
2016-03-12 18:32:21 -06:00
committed by Alexander Lamaison
parent 0268b974a7
commit f6a4ccf22b

View File

@@ -202,7 +202,16 @@ typedef off_t libssh2_struct_stat_size;
#endif
#ifndef LIBSSH2_STRUCT_STAT_SIZE_FORMAT
# define LIBSSH2_STRUCT_STAT_SIZE_FORMAT "%zd"
# ifdef __VMS
/* We have to roll our own format here because %z is a C99-ism we don't have. */
# if __USE_OFF64_T || __USING_STD_STAT
# define LIBSSH2_STRUCT_STAT_SIZE_FORMAT "%Ld"
# else
# define LIBSSH2_STRUCT_STAT_SIZE_FORMAT "%d"
# endif
# else
# define LIBSSH2_STRUCT_STAT_SIZE_FORMAT "%zd"
# endif
typedef struct stat libssh2_struct_stat;
typedef off_t libssh2_struct_stat_size;
#endif