Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative unistd.h header file for Visual Studio 2010

I am compiling the code in Visual Studio 2010 which includes header file unistd.h. Since windows does not have any support for the header file unistd.h , I am looking for the alternative header file or is there any way to customize it so that I can compile it in Visual Studio as well.

like image 377
thetna Avatar asked Dec 04 '22 21:12

thetna


1 Answers

Try include io.h, it's equivalent of unistd.h in MSVC. if you want to maintain the compatibility, try this:

#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h>
#endif
like image 136
Richard Avatar answered Dec 20 '22 16:12

Richard