summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/o_fopen.c3
-rw-r--r--crypto/rand/randfile.c12
2 files changed, 8 insertions, 7 deletions
diff --git a/crypto/o_fopen.c b/crypto/o_fopen.c
index a3a006574d..951d034dda 100644
--- a/crypto/o_fopen.c
+++ b/crypto/o_fopen.c
@@ -12,6 +12,9 @@
#if !defined(OPENSSL_NO_STDIO)
# include <stdio.h>
+# ifdef _WIN32
+# include <windows.h>
+# endif
FILE *openssl_fopen(const char *filename, const char *mode)
{
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index d4edc50b26..a979eb99a2 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -26,7 +26,12 @@
# include <sys/stat.h>
# include <fcntl.h>
# ifdef _WIN32
+# include <windows.h>
# include <io.h>
+# define stat _stat
+# define chmod _chmod
+# define open _open
+# define fdopen _fdopen
# endif
#endif
@@ -41,13 +46,6 @@
# define S_ISREG(m) ((m) & S_IFREG)
# endif
-#ifdef _WIN32
-# define stat _stat
-# define chmod _chmod
-# define open _open
-# define fdopen _fdopen
-#endif
-
#define RAND_FILE_SIZE 1024
#define RFILE ".rnd"