[libcxx-commits] [libcxx] [libc++][streams] P1759R6: Native handles and file streams (PR #76632)

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sun Dec 31 03:37:10 PST 2023


================
@@ -208,8 +216,37 @@ _LIBCPP_PUSH_MACROS
 
 #if !defined(_LIBCPP_HAS_NO_FILESYSTEM)
 
+#  if defined(_LIBCPP_WIN32API)
+#    define WIN32_LEAN_AND_MEAN
+#    define NOMINMAX
+#    include <io.h>
+#    include <windows.h>
+#  endif
+
+#include <fcntl.h>
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+#  if _LIBCPP_STD_VER >= 26
+#    if defined(_LIBCPP_WIN32API)
+using __filebuf_native_handle_type = void*; // HANDLE
+#    else
+using __filebuf_native_handle_type = int; // POSIX file descriptor
+#    endif
+_LIBCPP_HIDE_FROM_ABI __filebuf_native_handle_type __filebuf_native_handle(FILE* __file) noexcept;
----------------
mordante wrote:

This is a declaration.

https://github.com/llvm/llvm-project/pull/76632


More information about the libcxx-commits mailing list