Mercurial > hg > early-roguelike
comparison arogue5/mdport.c @ 196:80a590e67206
Advanced Rogue 5: add and use md_fdopen().
Portability is improved.
| author | John "Elwin" Edwards |
|---|---|
| date | Tue, 11 Aug 2015 15:15:09 -0400 |
| parents | 600873555ec0 |
| children | 61d1c9ac9be7 |
comparison
equal
deleted
inserted
replaced
| 195:beab22b087a1 | 196:80a590e67206 |
|---|---|
| 207 fd = open(file,O_CREAT | O_EXCL | O_WRONLY, mode); | 207 fd = open(file,O_CREAT | O_EXCL | O_WRONLY, mode); |
| 208 | 208 |
| 209 return(fd); | 209 return(fd); |
| 210 } | 210 } |
| 211 | 211 |
| 212 FILE * | |
| 213 md_fdopen(int fd, char *mode) | |
| 214 { | |
| 215 #ifdef _WIN32 | |
| 216 return( _fdopen(fd, mode) ); | |
| 217 #else | |
| 218 return( fdopen(fd, mode) ); | |
| 219 #endif | |
| 220 } | |
| 212 | 221 |
| 213 int | 222 int |
| 214 md_normaluser() | 223 md_normaluser() |
| 215 { | 224 { |
| 216 #ifndef _WIN32 | 225 #ifndef _WIN32 |
