On Thu, 9 Jan 2003, Dimitrie O. Paun wrote:
Folks,
We have a lot of code in msvcrt headers like so:
#define umask _umask #define unlink _unlink #define write _write
[...]
I suggest we turn those defines into inlines, like this:
inline int write(int fd, const void* ptr, unsigned int size) { return _write(fd, ptr, size); }
Any other solutions?
The strange thing is that the MSVC headers simply define their prototype, e.g.:
_CRTIMP int __cdecl umask(int);
Yet these APIs are not exported by the msvcrt library or by any other dll that I know of. And still applications compile and link!
In fact it seems that whether the application calls umask or _umask (even once preprocessed), MSVC will import _umask.
Anyway, replacing these defines with inline functions is fine with me.