Advanced Rogue 5: add and use md_fdopen().
Portability is improved.
This commit is contained in:
parent
c0f3e1f004
commit
47df21eb66
3 changed files with 11 additions and 1 deletions
|
|
@ -209,6 +209,15 @@ md_creat(char *file, int mode)
|
|||
return(fd);
|
||||
}
|
||||
|
||||
FILE *
|
||||
md_fdopen(int fd, char *mode)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return( _fdopen(fd, mode) );
|
||||
#else
|
||||
return( fdopen(fd, mode) );
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
md_normaluser()
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ short monst;
|
|||
printf("\nCannot open score_file.\n");
|
||||
return;
|
||||
}
|
||||
outf = (FILE *) fdopen(fd, "w");
|
||||
outf = (FILE *) md_fdopen(fd, "w");
|
||||
|
||||
/* Get this system's name */
|
||||
thissys = md_gethostname();
|
||||
|
|
|
|||
|
|
@ -983,6 +983,7 @@ extern char *md_getpass();
|
|||
extern char *md_crypt();
|
||||
extern char *md_getroguedir();
|
||||
extern void md_init();
|
||||
extern FILE * md_fdopen(int fd, char *mode);
|
||||
|
||||
/*
|
||||
* Now all the global variables
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue