summaryrefslogtreecommitdiff
path: root/src/lib/cross.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-25 00:28:26 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-25 00:28:26 +0000
commita9dd3d27bc52f853309885b1be02d6efd2d2af48 (patch)
tree34ca2469fff6d71a85edef547d793d58fe7a0df7 /src/lib/cross.cc
parentad0ddd25c94730bed174756a21c83a348c45687e (diff)
Add fopen_boost; remove a couple of defunct usings.
Diffstat (limited to 'src/lib/cross.cc')
-rw-r--r--src/lib/cross.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/cross.cc b/src/lib/cross.cc
index 41051ee2e..9aa8454c9 100644
--- a/src/lib/cross.cc
+++ b/src/lib/cross.cc
@@ -269,3 +269,19 @@ openssl_path ()
#endif
}
+
+/* Apparently there is no way to create an ofstream using a UTF-8
+ filename under Windows. We are hence reduced to using fopen
+ with this wrapper.
+*/
+FILE *
+fopen_boost (boost::filesystem::path p, string t)
+{
+#ifdef DCPOMATIC_WINDOWS
+ wstring w (t.begin(), t.end());
+ /* c_str() here should give a UTF-16 string */
+ return _wfopen (p.c_str(), w.c_str ());
+#else
+ return fopen (p.c_str(), t.c_str ());
+#endif
+}