jash-kothari-forks / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
0 stars 0 forks source link

[PATCH] fix build on GNU/kFreeBSD #487

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Compiling libtorrent 0.16.10 fails on Debian GNU/kFreeBSD.

What is the expected output? What do you see instead?
The compilation fails on escape_string.cpp:
  CXX      escape_string.lo
../../src/escape_string.cpp: In function 'std::string 
libtorrent::iconv_convert_impl(const string&, iconv_t)':
../../src/escape_string.cpp:547:18: error: invalid conversion from 'const 
char**' to 'char**' [-fpermissive]
In file included from ../../src/escape_string.cpp:62:0:
/usr/include/iconv.h:42:15: error:   initializing argument 2 of 'size_t 
iconv(iconv_t, char**, size_t*, char**, size_t*)' [-fpermissive]

What version of the product are you using? On what operating system?
libtorrent 0.16.10 on Debian GNU/kFreeBSD (FreeBSD kernel with GNU userland).

Please provide any additional information below.
Since GNU libc is used, the iconv implementation is provided there too, and its 
signature does not have the const qualifiers in the iconv() parameters.
Thus, the attached patch avoids the TORRENT_ICONV_ARG definition in the 
BSD-specific branch in config.hpp when __GLIBC__ is defined (i.e. when GNU libc 
is used), which will make the const-less TORRENT_ICONV_ARG define being used.

Original issue reported on code.google.com by toscano....@tiscali.it on 19 Jun 2013 at 4:05

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks. Applied to RC_0_16 and trunk. It will be in the next release.

Original comment by arvid.no...@gmail.com on 20 Jun 2013 at 1:12