From 04e8824004970f6889b9df126b5db343013c82c9 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Wed, 17 Jun 2009 22:21:10 +0100 Subject: [PATCH] win32: Define the ssize_t type using SSIZE_T if supported Some win32 compilers define the SSIZE_T type, with the same meaning and intent as ssize_t. If available, make ssize_t a synonym of SSIZE_T. At present, the Digital-Mars compiler is known not to define SSIZE_T, so we provide an SSIZE_T macro to use in the typedef. Signed-off-by: Ramsay Jones --- src/common.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common.h b/src/common.h index d4b976905..a73891d7c 100644 --- a/src/common.h +++ b/src/common.h @@ -31,13 +31,16 @@ # define snprintf _snprintf -# if (defined(_MSC_VER) && defined(_WIN64)) || \ - (defined(__DMC__) && defined(_M_AMD64)) - typedef long long ssize_t; -# else - typedef int ssize_t; +# if defined(__DMC__) +# if defined(_M_AMD64) +# define SSIZE_T long long +# else +# define SSIZE_T int +# endif # endif +typedef SSIZE_T ssize_t; + # if defined(_MSC_VER) /* access() mode parameter #defines */ # define F_OK 0 /* existence check */