Spirit file_iterator with windows/unicode

When using <boost/spirit/iterator/file_iterator.hpp> with windows when UNICODE is defined, the following: file_iterator<> file( "foobar.txt" ); will fail to compile since the call to ::CreateFile in <boost/spirit/iterator/impl/file_iterator.ipp> line 182 maps to CreateFileW and not CreateFileA which is wanting a wide-character filename. The solution is thus: <boost/spirit/iterator/impl/file_iterator.ipp> line 182: - HANDLE hFile = ::CreateFile( + HANDLE hFile = ::CreateFileA( Regards, Reece _________________________________________________________________ Express yourself with cool emoticons - download MSN Messenger today! http://www.msn.co.uk/messenger

Reece Dunn wrote:
When using <boost/spirit/iterator/file_iterator.hpp> with windows when UNICODE is defined, the following:
file_iterator<> file( "foobar.txt" );
will fail to compile since the call to ::CreateFile in <boost/spirit/iterator/impl/file_iterator.ipp> line 182 maps to CreateFileW and not CreateFileA which is wanting a wide-character filename. The solution is thus:
<boost/spirit/iterator/impl/file_iterator.ipp> line 182: - HANDLE hFile = ::CreateFile( + HANDLE hFile = ::CreateFileA(
Thanks Reece. Applied to all pertinent CVS and branches. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (2)
-
Joel de Guzman
-
Reece Dunn