Commit 04e8824004970f6889b9df126b5db343013c82c9

Ramsay Jones 2009-06-17T22:21:10

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 <ramsay@ramsay1.demon.co.uk>

diff --git a/src/common.h b/src/common.h
index d4b9769..a73891d 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 */