made most examples build without exception support

This commit is contained in:
Arvid Norberg
2007-12-30 01:59:10 +00:00
parent 07d1fe84c3
commit dfd563dfbb
3 changed files with 13 additions and 3 deletions

View File

@@ -85,8 +85,10 @@ int main(int argc, char* argv[])
return 1;
}
#ifndef BOOST_NO_EXCEPTIONS
try
{
#endif
boost::intrusive_ptr<torrent_info> t(new torrent_info);
path full_path = complete(path(argv[3]));
ofstream out(complete(path(argv[1])), std::ios_base::binary);
@@ -121,11 +123,13 @@ int main(int argc, char* argv[])
// create the torrent and print it to out
entry e = t->create_torrent();
libtorrent::bencode(std::ostream_iterator<char>(out), e);
#ifndef BOOST_NO_EXCEPTIONS
}
catch (std::exception& e)
{
std::cerr << e.what() << "\n";
}
#endif
return 0;
}