为Visual Studio 2010的替代unistd.h中头文件 [英] Alternative unistd.h header file for Visual Studio 2010
本文介绍了为Visual Studio 2010的替代unistd.h中头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在编译的Visual Studio 2010
,其中包括头文件 unistd.h中
的code。由于Windows不具备的头文件 unistd.h中
任何支持,我在寻找替代头文件或者有没有什么办法来定制它,这样我可以编译在Visual Studio中也是如此。
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.
推荐答案
尝试包括io.h,这相当于在MSVC unistd.h中的。如果你想保持兼容性,试试这个:
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
这篇关于为Visual Studio 2010的替代unistd.h中头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文