Engage Applink in mingw. Note that application-side module is not
[openssl.git] / crypto / bio / bss_file.c
index c97ac14..dd17802 100644 (file)
@@ -236,12 +236,17 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
                b->shutdown=(int)num&BIO_CLOSE;
                b->ptr=ptr;
                b->init=1;
-#if BIO_FLAGS_UPLINK!=0 && defined(_IOB_ENTRIES)
+#if BIO_FLAGS_UPLINK!=0
+#if defined(__MINGW32__) && defined(__MSVCRT__) && !defined(_IOB_ENTRIES)
+#define _IOB_ENTRIES 20
+#endif
+#if defined(_IOB_ENTRIES)
                /* Safety net to catch purely internal BIO_set_fp calls */
                if ((size_t)ptr >= (size_t)stdin &&
                    (size_t)ptr <  (size_t)(stdin+_IOB_ENTRIES))
                        BIO_clear_flags(b,BIO_FLAGS_UPLINK);
 #endif
+#endif
 #ifdef UP_fsetmode
                if (b->flags&BIO_FLAGS_UPLINK)
                        UP_fsetmode(b->ptr,num&BIO_FP_TEXT?'t':'b');