[clang] [lld] [llvm] [flang] [libcxx] [libc++][streams] P1759R6: Native handles and file streams (PR #76632)

Hristo Hristov via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 31 23:22:39 PST 2023


================
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include <__config>
+#include <cstdio>
+#include <fstream>
+
+#if defined(_LIBCPP_WIN32API)
+#  define WIN32_LEAN_AND_MEAN
+#  define NOMINMAX
+#  include <io.h>
+#  include <windows.h>
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 26
+_LIBCPP_EXPORTED_FROM_ABI __filebuf_native_handle_type __filebuf_native_handle(FILE* __file) noexcept {
----------------
H-G-Hristov wrote:

Thank you for the tip! It helped me a lot!

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


More information about the cfe-commits mailing list