相关疑难解决方法(0)

如何在OS X上从std :: basic_ios获取文件描述符for clang?

我将一些代码移植到Darwin OS X,作为更改的一部分,我们从gcc转到clang编译器.

在代码中,有一个功能可追溯到2005年,并在互联网上发布了几个地方.它为几个不同的旧版GCC提供了功能,我已经删除了它提供的最后一个版本,v3.4.0或更高版本.代码取决于两个GCC特定类:__gnu_cxx::stdio_filebuf__gnu_cxx::stdio_sync_filebuf.

//! Similar to fileno(3), but taking a C++ stream as argument instead of a
//! FILE*.  Note that there is no way for the library to track what you do with
//! the descriptor, so be careful.
//! \return  The integer file descriptor associated with the stream, or -1 if
//!   that stream is invalid.  In the latter case, for the sake of keeping the
//!   code as similar to fileno(3), errno …
Run Code Online (Sandbox Code Playgroud)

c++ macos porting iostream file-descriptor

9
推荐指数
1
解决办法
1028
查看次数

标签 统计

c++ ×1

file-descriptor ×1

iostream ×1

macos ×1

porting ×1