Blame luxcorerender-pr611-boost_181.patch

5da042c
From 2babe4d3c0f52d82b6b6ac13f269b4a4e8c3b403 Mon Sep 17 00:00:00 2001
5da042c
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
5da042c
Date: Thu, 9 Mar 2023 22:55:50 +0900
5da042c
Subject: [PATCH] FIX: support boost 1.81
5da042c
5da042c
https://www.boost.org/users/history/version_1_79_0.html
5da042c
5da042c
boost 1.79 deprecated boost/filesystem/string_file.hpp and
5da042c
with boost 1.81 boost::filesystem::ofstream or so is no longer
5da042c
available.
5da042c
5da042c
Replace these with boost::nowide in boost/nowide/fstream.hpp .
5da042c
5da042c
Fixes #610 .
5da042c
---
5da042c
 src/luxrays/utils/cuda.cpp | 13 +++++++------
5da042c
 src/luxrays/utils/ocl.cpp  | 13 +++++++------
5da042c
 2 files changed, 14 insertions(+), 12 deletions(-)
5da042c
5da042c
diff --git a/src/luxrays/utils/cuda.cpp b/src/luxrays/utils/cuda.cpp
5da042c
index 6ae9e9f42..de9f11df5 100644
5da042c
--- a/src/luxrays/utils/cuda.cpp
5da042c
+++ b/src/luxrays/utils/cuda.cpp
5da042c
@@ -24,6 +24,7 @@
5da042c
 
5da042c
 #include <boost/algorithm/string/replace.hpp>
5da042c
 #include <boost/algorithm/string/trim.hpp>
5da042c
+#include <boost/nowide/fstream.hpp>
5da042c
 
5da042c
 #include "luxrays/luxrays.h"
5da042c
 #include "luxrays/utils/utils.h"
5da042c
@@ -174,10 +175,10 @@ bool cudaKernelPersistentCache::CompilePTX(const vector<string> &kernelsParamete
5da042c
 
5da042c
 			// The use of boost::filesystem::path is required for UNICODE support: fileName
5da042c
 			// is supposed to be UTF-8 encoded.
5da042c
-			boost::filesystem::ofstream file(boost::filesystem::path(fileName),
5da042c
-					boost::filesystem::ofstream::out |
5da042c
-					boost::filesystem::ofstream::binary |
5da042c
-					boost::filesystem::ofstream::trunc);
5da042c
+			boost::nowide::ofstream file(boost::filesystem::path(fileName),
5da042c
+					boost::nowide::ofstream::out |
5da042c
+					boost::nowide::ofstream::binary |
5da042c
+					boost::nowide::ofstream::trunc);
5da042c
 
5da042c
 			// Write the binary hash
5da042c
 			const u_int hashBin = oclKernelPersistentCache::HashBin(*ptx, *ptxSize);
5da042c
@@ -206,8 +207,8 @@ bool cudaKernelPersistentCache::CompilePTX(const vector<string> &kernelsParamete
5da042c
 
5da042c
 			// The use of boost::filesystem::path is required for UNICODE support: fileName
5da042c
 			// is supposed to be UTF-8 encoded.
5da042c
-			boost::filesystem::ifstream file(boost::filesystem::path(fileName),
5da042c
-					boost::filesystem::ifstream::in | boost::filesystem::ifstream::binary);
5da042c
+			boost::nowide::ifstream file(boost::filesystem::path(fileName),
5da042c
+					boost::nowide::ifstream::in | boost::nowide::ifstream::binary);
5da042c
 
5da042c
 			// Read the binary hash
5da042c
 			u_int hashBin;
5da042c
diff --git a/src/luxrays/utils/ocl.cpp b/src/luxrays/utils/ocl.cpp
5da042c
index 785836cef..a31af9ed6 100644
5da042c
--- a/src/luxrays/utils/ocl.cpp
5da042c
+++ b/src/luxrays/utils/ocl.cpp
5da042c
@@ -24,6 +24,7 @@
5da042c
 
5da042c
 #include <boost/algorithm/string/replace.hpp>
5da042c
 #include <boost/algorithm/string/trim.hpp>
5da042c
+#include <boost/nowide/fstream.hpp>
5da042c
 
5da042c
 #include "luxrays/luxrays.h"
5da042c
 #include "luxrays/utils/utils.h"
5da042c
@@ -303,10 +304,10 @@ cl_program oclKernelPersistentCache::Compile(cl_context context, cl_device_id de
5da042c
 
5da042c
 			// The use of boost::filesystem::path is required for UNICODE support: fileName
5da042c
 			// is supposed to be UTF-8 encoded.
5da042c
-			boost::filesystem::ofstream file(boost::filesystem::path(fileName),
5da042c
-					boost::filesystem::ofstream::out |
5da042c
-					boost::filesystem::ofstream::binary |
5da042c
-					boost::filesystem::ofstream::trunc);
5da042c
+			boost::nowide::ofstream file(boost::filesystem::path(fileName),
5da042c
+					boost::nowide::ofstream::out |
5da042c
+					boost::nowide::ofstream::binary |
5da042c
+					boost::nowide::ofstream::trunc);
5da042c
 
5da042c
 			// Write the binary hash
5da042c
 			const u_int hashBin = HashBin(bins, binsSizes[0]);
5da042c
@@ -337,8 +338,8 @@ cl_program oclKernelPersistentCache::Compile(cl_context context, cl_device_id de
5da042c
 
5da042c
 			// The use of boost::filesystem::path is required for UNICODE support: fileName
5da042c
 			// is supposed to be UTF-8 encoded.
5da042c
-			boost::filesystem::ifstream file(boost::filesystem::path(fileName),
5da042c
-					boost::filesystem::ifstream::in | boost::filesystem::ifstream::binary);
5da042c
+			boost::nowide::ifstream file(boost::filesystem::path(fileName),
5da042c
+					boost::nowide::ifstream::in | boost::nowide::ifstream::binary);
5da042c
 
5da042c
 			// Read the binary hash
5da042c
 			u_int hashBin;