gtorrent / gtorrent-core

Core library of gTorrent which handles everything but UI/UX
GNU General Public License v3.0
39 stars 12 forks source link

Changed Core.cpp so that it should build on both windows and linux #59

Closed zovt closed 9 years ago

zovt commented 10 years ago

This change allows gtorrent-core to be built on windows. Otherwise, the compiler throws an error:

C:/msys32/home/Nick/gtorrent-ncurses/lib/gtorrent-core/src/Core.cpp:50:21: error: no match for 'operator=' (operand types are 'std::vector<char>' and 'std::vector<char>*')
  params.resume_data = resumedata; //TODO: Look if fast resume data exists for this torrent

NOTE: I have not tested this in any gui-kit, so I don't know whether this will affect functionality.

benwaffle commented 10 years ago

this shouldn't be platform specific, it's a C++ error somewhere won't merge as it is right now

fuyukaidesu commented 10 years ago

Check what include/libtorrent/add_torrent_params.hpp says about the member params.resume_data, normally it is a vector*, or you may have an older build.

innix commented 10 years ago

It is std::vector<char> in the latest trunk: http://sourceforge.net/p/libtorrent/code/HEAD/tree/trunk/include/libtorrent/add_torrent_params.hpp#l300

The platform check isn't necessary, the code should be params.resume_data = *resumedata;