Skip to content

Commit

Permalink
Compiling with BOOST_NO_IOSTREAM
Browse files Browse the repository at this point in the history
  • Loading branch information
aldenml committed Feb 3, 2016
1 parent 864305b commit 5e2283e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
3 changes: 3 additions & 0 deletions swig/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ feature.compose <wrap-posix>on :
<linkflags>-Wl,--wrap=remove
;

feature iostream : off on : composite propagated link-incompatible ;
feature.compose <iostream>off : <define>BOOST_NO_IOSTREAM ;

lib jlibtorrent

: # sources
Expand Down
1 change: 1 addition & 0 deletions swig/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'BOOST_MULTI_INDEX_DISABLE_SERIALIZATION',
'BOOST_SYSTEM_NO_DEPRECATED',
'BOOST_SYSTEM_STATIC_LINK=1',
'BOOST_NO_IOSTREAM',
'NDEBUG',
'TORRENT_DISK_STATS',
'TORRENT_NO_DEPRECATE',
Expand Down
4 changes: 2 additions & 2 deletions swig/libtorrent.i
Original file line number Diff line number Diff line change
Expand Up @@ -1073,11 +1073,11 @@ namespace libtorrent {

%extend sha1_hash {
std::string to_hex() {
return to_hex($self->to_string());
return libtorrent::to_hex($self->to_string());
}

static bool from_hex(char *hex, sha1_hash& h) {
return from_hex(hex, 40, (char*)&h[0]);
return libtorrent::from_hex(hex, 40, (char*)&h[0]);
}
};

Expand Down
8 changes: 4 additions & 4 deletions swig/libtorrent_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1388,10 +1388,10 @@ SWIGINTERN libtorrent::entry libtorrent_entry_bdecode(std::vector< char > &buffe
return bdecode(buffer.begin(), buffer.end());
}
SWIGINTERN std::string libtorrent_sha1_hash_to_hex(libtorrent::sha1_hash *self){
return to_hex(self->to_string());
return libtorrent::to_hex(self->to_string());
}
SWIGINTERN bool libtorrent_sha1_hash_from_hex(char *hex,libtorrent::sha1_hash &h){
return from_hex(hex, 40, (char*)&h[0]);
return libtorrent::from_hex(hex, 40, (char*)&h[0]);
}
SWIGINTERN time_t libtorrent_torrent_info_get_creation_date(libtorrent::torrent_info *self){
return self->creation_date().get_value_or(0);
Expand Down Expand Up @@ -64275,7 +64275,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_L

(void)jenv;
(void)jcls;
result = (char *)("38c1b1d93280a8e865977fc9a176ec32896a053b");
result = (char *)("930a33b59c49965a8a2caa13517b21e3142078af");
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
Expand All @@ -64287,7 +64287,7 @@ SWIGEXPORT jstring JNICALL Java_com_frostwire_jlibtorrent_swig_libtorrent_1jni_J

(void)jenv;
(void)jcls;
result = (char *)("9fdad5c9f78883032c4c1b1d7bb6c3aacdf94ff3");
result = (char *)("864305be12ea95f6f32ffd7621db705e967a26f2");
if (result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
Expand Down
8 changes: 4 additions & 4 deletions swig/libtorrent_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2801,10 +2801,10 @@ SWIGINTERN libtorrent::entry libtorrent_entry_bdecode(std::vector< char > &buffe
return bdecode(buffer.begin(), buffer.end());
}
SWIGINTERN std::string libtorrent_sha1_hash_to_hex(libtorrent::sha1_hash *self){
return to_hex(self->to_string());
return libtorrent::to_hex(self->to_string());
}
SWIGINTERN bool libtorrent_sha1_hash_from_hex(char *hex,libtorrent::sha1_hash &h){
return from_hex(hex, 40, (char*)&h[0]);
return libtorrent::from_hex(hex, 40, (char*)&h[0]);
}
SWIGINTERN time_t libtorrent_torrent_info_get_creation_date(libtorrent::torrent_info *self){
return self->creation_date().get_value_or(0);
Expand Down Expand Up @@ -108425,7 +108425,7 @@ static SwigV8ReturnValue _wrap_LIBTORRENT_REVISION_SHA1(v8::Local<v8::String> pr

v8::Handle<v8::Value> jsresult;

jsresult = SWIG_FromCharPtr((const char *)"38c1b1d93280a8e865977fc9a176ec32896a053b");
jsresult = SWIG_FromCharPtr((const char *)"930a33b59c49965a8a2caa13517b21e3142078af");

SWIGV8_RETURN_INFO(jsresult, info);

Expand All @@ -108440,7 +108440,7 @@ static SwigV8ReturnValue _wrap_JLIBTORRENT_REVISION_SHA1(v8::Local<v8::String> p

v8::Handle<v8::Value> jsresult;

jsresult = SWIG_FromCharPtr((const char *)"9fdad5c9f78883032c4c1b1d7bb6c3aacdf94ff3");
jsresult = SWIG_FromCharPtr((const char *)"864305be12ea95f6f32ffd7621db705e967a26f2");

SWIGV8_RETURN_INFO(jsresult, info);

Expand Down
2 changes: 2 additions & 0 deletions swig/run-swig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function runJni()
-DBOOST_SYSTEM_NOEXCEPT="" \
-DBOOST_SYSTEM_DECL="" \
-DBOOST_SYSTEM_NO_DEPRECATED=1 \
-DBOOST_NO_IOSTREAM \
-DTORRENT_CFG="TORRENT_CFG" \
-DTORRENT_NO_DEPRECATE=1 \
-DTORRENT_DEPRECATED_EXPORT="" \
Expand Down Expand Up @@ -63,6 +64,7 @@ function runNode()
-DBOOST_SYSTEM_NOEXCEPT="" \
-DBOOST_SYSTEM_DECL="" \
-DBOOST_SYSTEM_NO_DEPRECATED=1 \
-DBOOST_NO_IOSTREAM \
-DTORRENT_CFG="TORRENT_CFG" \
-DTORRENT_NO_DEPRECATE=1 \
-DTORRENT_DEPRECATED_EXPORT="" \
Expand Down

2 comments on commit 5e2283e

@gubatron
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the story for no iostream? what does it use instead?
(just to learn)

@aldenml
Copy link
Collaborator Author

@aldenml aldenml commented on 5e2283e Feb 4, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a way to effectively disable any include of <iostream> and/or related includes. It helps to statically check if you are using iostream templates code or not, and if you don't use them, there is a significant space save in the final binary. In the process a minor fix in libtorrent was necessary arvidn/libtorrent#455

Please sign in to comment.