[sdpb] 174/233: Added BOOST_WINDOWS_API support to parse.cpp

Tobias Hansen thansen at moszumanska.debian.org
Thu Mar 9 04:06:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository sdpb.

commit 352578bc7a4b6841e53238b6b15b57339690b9fc
Author: pkravchuk <pkravchuk at users.noreply.github.com>
Date:   Tue Oct 20 16:06:33 2015 -0700

    Added BOOST_WINDOWS_API support to parse.cpp
    
    path.c_str() returns value_type*, which is a wchar_t* if BOOST_WINDOWS_API is defined. Tinyxml uses fopen to open files, which does not take wchar_t argument. This fix leaves tinyxml invariant, but there can be an error if a file with non-ascii characters is being opened. Windows workaround is wfopen, but this function is not available on Cygwin, which is the environment that is most likely to be used on Windows to build sdpb. Cygwin follows posix, so that's why wfopen is not availabl [...]
---
 src/parse.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/parse.cpp b/src/parse.cpp
index 3222046..9190926 100644
--- a/src/parse.cpp
+++ b/src/parse.cpp
@@ -92,6 +92,10 @@ SDP parseBootstrapSDP(XMLElement *xml) {
 
 SDP readBootstrapSDP(const path sdpFile) {
   XMLDocument doc;
+#ifndef BOOST_WINDOWS_API
   doc.LoadFile(sdpFile.c_str());
-  return parseBootstrapSDP(doc.FirstChildElement("sdp"));
+#else
+  doc.LoadFile(sdpFile.string().c_str());
+#endif  
+return parseBootstrapSDP(doc.FirstChildElement("sdp"));
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sdpb.git



More information about the debian-science-commits mailing list