diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-12-09 22:33:31 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-12-09 22:33:31 +0000 |
commit | 6290daa5478863da4b4c59c494c69bc49e845128 (patch) | |
tree | 8766c612c4a8d397fae0c554844affc740fdcfa1 /lib | |
parent | 00a5a49f1887236bc1de5adebcd77be03a6b13a0 (diff) |
Remove #defines of POSIX functions deprecated by Microsoft.
These defines are too wide-reaching in their effects on unrelated code.
Add a replacement for strncasecmp.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/win32/emu.h | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/win32/emu.h b/lib/win32/emu.h index 4b263e22..8014316a 100644 --- a/lib/win32/emu.h +++ b/lib/win32/emu.h @@ -65,17 +65,6 @@ #define ITIMER_REAL 0 -#ifdef _MSC_VER -// Microsoft decided to deprecate the standard POSIX functions. Great! -#define open(file,flags,mode) _open(file,flags,mode) -#define close(fd) _close(fd) -#define dup(fd) _dup(fd) -#define read(fd,buf,count) _read(fd,buf,count) -#define write(fd,buf,count) _write(fd,buf,count) -#define lseek(fd,off,whence) _lseek(fd,off,whence) -#define fileno(struct_file) _fileno(struct_file) -#endif - struct passwd { char *pw_name; char *pw_passwd; @@ -204,7 +193,11 @@ inline int geteuid(void) #define snprintf _snprintf inline int strcasecmp(const char *s1, const char *s2) { - return _stricmp(s1,s2); + return _stricmp(s1, s2); +} +inline int strncasecmp(const char *s1, const char *s2, size_t count) +{ + return _strnicmp(s1, s2, count); } #endif |