# include <io.h>
# include <fcntl.h>
+# ifdef __MINGW32__
+# define ssize_t long
+# endif
+
# if defined (__BORLANDC__)
# define _setmode setmode
# define _O_TEXT O_TEXT
# include <sys/types.h>
# endif
# ifdef NeXT
-# define pid_t int /* pid_t is missing on NEXTSTEP/OPENSTEP */
+# define pid_t int /* pid_t is missing on NEXTSTEP/OPENSTEP
+ * (unless when compiling with -D_POSIX_SOURCE,
+ * which doesn't work for us) */
+# define ssize_t int /* ditto */
# endif
# define OPENSSL_CONF "openssl.cnf"