wrap gets on Windows, replacing '\r\n' with '\n'

This commit is contained in:
Brent Cook
2015-12-05 13:58:37 -06:00
parent d7317353a9
commit 75ef5bb160
2 changed files with 16 additions and 0 deletions

View File

@@ -28,11 +28,13 @@ int asprintf(char **str, const char *fmt, ...);
void posix_perror(const char *s);
FILE * posix_fopen(const char *path, const char *mode);
char * posix_fgets(char *s, int size, FILE *stream);
int posix_rename(const char *oldpath, const char *newpath);
#ifndef NO_REDEF_POSIX_FUNCTIONS
#define perror(errnum) posix_perror(errnum)
#define fopen(path, mode) posix_fopen(path, mode)
#define fgets(s, size, stream) posix_fgets(s, size, stream)
#define rename(oldpath, newpath) posix_rename(oldpath, newpath)
#endif