summaryrefslogtreecommitdiffstats
path: root/external/liborcus/boost-filesystem.patch.1
blob: 14128b4e1c674d93596362ce4d17900c635f43e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From e44737bad582fa2a05a23820e49d7930db710412 Mon Sep 17 00:00:00 2001
From: Kohei Yoshida <kohei.yoshida@gmail.com>
Date: Tue, 2 Nov 2021 21:33:19 -0400
Subject: [PATCH] Try using boost::filesystem instead of std::filesystem.

std::filesystem still seems unreliable.
---
 src/parser/stream.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/parser/stream.cpp b/src/parser/stream.cpp
index 09855300..00395f59 100644
--- a/src/parser/stream.cpp
+++ b/src/parser/stream.cpp
@@ -17,12 +17,12 @@
 #include <locale>
 #include <codecvt>
 #include <iostream>
-#include <filesystem>
 
+#include <boost/filesystem.hpp>
 #include <boost/interprocess/file_mapping.hpp>
 #include <boost/interprocess/mapped_region.hpp>
 
-namespace fs = std::filesystem;
+namespace fs = boost::filesystem;
 namespace bip = boost::interprocess;
 
 namespace orcus {
@@ -162,7 +162,7 @@ struct file_content::impl
     impl() : content_size(0), content(nullptr) {}
 
     impl(std::string_view filepath) :
-        content_size(fs::file_size(filepath)),
+        content_size(fs::file_size(std::string{filepath}.c_str())),
         mapped_file(std::string{filepath}.c_str(), bip::read_only),
         mapped_region(mapped_file, bip::read_only, 0, content_size),
         content(nullptr)
-- 
2.25.1