diff arogue7/mdport.c @ 203:aa8e1fc62926

Advanced Rogue 7: add and use more md_ functions. md_fileno() and md_fdopen() are now included. I still hope to rewrite everything to use FILE *'s.
author John "Elwin" Edwards
date Thu, 13 Aug 2015 07:38:57 -0400
parents e69128d2e4c5
children f9ef86cf22b2
line wrap: on
line diff
--- a/arogue7/mdport.c	Wed Aug 12 17:03:15 2015 -0400
+++ b/arogue7/mdport.c	Thu Aug 13 07:38:57 2015 -0400
@@ -175,6 +175,26 @@
 #endif
 }
 
+FILE *
+md_fdopen(int fd, char *mode)
+{
+#ifdef _WIN32
+    return( _fdopen(fd, mode) );
+#else
+    return( fdopen(fd, mode) );
+#endif
+}
+
+int
+md_fileno(FILE *fp)
+{
+#ifdef _WIN32
+    return( _fileno(fp) );
+#else
+    return( fileno(fp) );
+#endif
+}
+
 int
 md_creat(char *file, int mode)
 {