Use inline functions instead of macros to avoid problems in C++.
Inline functions respect scope, whereas macros don't.
Define umask in sys/stat.h, and mode_t in sys/types.h.

diff --git a/include/msvcrt/stdio.h b/include/msvcrt/stdio.h
index 91506ff..dee46c5 100644
--- a/include/msvcrt/stdio.h
+++ b/include/msvcrt/stdio.h
@@ -263,7 +263,10 @@
 #define pclose   _pclose
 #define popen    _popen
 #define tempnam  _tempnam
-#define unlink _unlink
+#ifndef MSVCRT_UNLINK_DEFINED
+static inline int unlink(const char* path) { return _unlink(path); }
+#define MSVCRT_UNLINK_DEFINED
+#endif
 
 #define fgetwchar _fgetwchar
 #define fputwchar _fputwchar