Questions tagged «unistd.h»

9
Windows(Visual C)是否可以替代unistd.h?
我正在将一个为Unix编写的相对简单的控制台程序移植到Windows平台(Visual C ++ 8.0)。所有源文件都包含“ unistd.h”,该文件不存在。删除它,我会抱怨缺少“ srandom”,“ random”和“ getopt”的原型。我知道我可以替换随机函数,而且我很确定自己可以找到/破解一个getopt实现。 但是我敢肯定,其他人也会遇到同样的挑战。我的问题是:Windows是否有“ unistd.h”端口?至少有一个包含本机Windows实现的功能-我不需要管道或分支。 编辑: 我知道我可以创建自己的“ unistd.h”,其中包含我需要的东西的替代品-特别是在这种情况下,因为这是一个有限的集合。但是由于这似乎是一个常见问题,所以我想知道是否有人已经为更大的功能子集完成了工作。 在工作中无法切换到其他编译器或环境-我对Visual Studio感到困惑。
165 c++  c  windows  portability  unistd.h 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.