Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| [EMAIL PROTECTED] wrote:
| > Author: larsbj
| > Date: Mon Aug 14 00:54:59 2006
| > New Revision: 14661
| > URL: http://www.lyx.org/trac/changeset/14661
| > Log:
| > Merge the unicode branch into trunk.
|
| Congratulation Lars.
|
| I need the attached patch to compile with MSVC. I am comitting now if
| you don't mind.
|
| Could you give us a short status report of what's missing (except for
| bug fixing of course)?
|
| Abdel.
| Index: support/unicode.C
| ===================================================================
| --- support/unicode.C (revision 14662)
| +++ support/unicode.C (working copy)
| @@ -16,6 +16,10 @@
|
| #include "debug.h"
|
| +#include <boost/cstdint.hpp>
| +
| +#include <iconv.h>
| +
| #include <cerrno>
| #include <iomanip>
| #include <string>
| @@ -45,7 +49,7 @@
| }
| }
|
| - char * inbuf = const_cast<char *>(&buf[0]);
| + char const * inbuf = const_cast<char *>(&buf[0]);
And what is the point of the const_cast then?
IMO this should not be const.
line59:
size_t res = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
MSVC tells me that it cannot convert inbuf from "char *" to "const char *"
| size_t inbytesleft = buf.size();
| char out[1000] = { 0 };
| char * outbuf = out;
| @@ -108,7 +112,7 @@
| {
| //lyxerr << "Outbuf =" << std::hex;
|
| - std::vector<uint32_t> ucs4;
| + std::vector<boost::uint32_t> ucs4;
So, the win compiler has a problem with lookup,
No, I think uint32_t is also defined in the global namespace and that's
what gcc uses here. So I guess you'd better explicitly specify boost::.
but please add a
'using' statement instead.
using boost::uint32_t;
If you want but you are using boost::uint32_t just two lines before.
std::vector<boost::uint32_t> bytes_to_ucs4(std::vector<char> const & bytes)
{
//lyxerr << "Outbuf =" << std::hex;
std::vector<boost::uint32_t> ucs4;