fix gen_fwd.py to correctly put declarations in the dht namespace that belong there
This commit is contained in:
parent
621da10e60
commit
37ffe99a19
|
@ -179,10 +179,6 @@ class hasher;
|
||||||
struct ip_filter;
|
struct ip_filter;
|
||||||
class port_filter;
|
class port_filter;
|
||||||
|
|
||||||
// include/libtorrent/kademlia/dht_storage.hpp
|
|
||||||
struct dht_storage_counters;
|
|
||||||
struct dht_storage_interface;
|
|
||||||
|
|
||||||
// include/libtorrent/peer_connection_handle.hpp
|
// include/libtorrent/peer_connection_handle.hpp
|
||||||
struct peer_connection_handle;
|
struct peer_connection_handle;
|
||||||
struct bt_peer_connection_handle;
|
struct bt_peer_connection_handle;
|
||||||
|
@ -244,6 +240,14 @@ class torrent_info;
|
||||||
// include/libtorrent/torrent_status.hpp
|
// include/libtorrent/torrent_status.hpp
|
||||||
struct torrent_status;
|
struct torrent_status;
|
||||||
|
|
||||||
|
namespace dht {
|
||||||
|
|
||||||
|
// include/libtorrent/kademlia/dht_storage.hpp
|
||||||
|
struct dht_storage_counters;
|
||||||
|
struct dht_storage_interface;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef TORRENT_NO_DEPRECATE
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
|
|
||||||
// include/libtorrent/alert_types.hpp
|
// include/libtorrent/alert_types.hpp
|
||||||
|
|
|
@ -57,6 +57,7 @@ deprecated_classes = os.popen('git grep TORRENT_DEPRECATED_EXPORT').read().split
|
||||||
def filter_classes(classes, keyword):
|
def filter_classes(classes, keyword):
|
||||||
current_file = ''
|
current_file = ''
|
||||||
ret = ''
|
ret = ''
|
||||||
|
dht_ret = ''
|
||||||
for c in classes:
|
for c in classes:
|
||||||
line = c.split(':', 1)
|
line = c.split(':', 1)
|
||||||
if not line[0].endswith('.hpp'): continue
|
if not line[0].endswith('.hpp'): continue
|
||||||
|
@ -71,13 +72,22 @@ def filter_classes(classes, keyword):
|
||||||
# TODO: support TORRENT_DEPRECATED_EXPORT
|
# TODO: support TORRENT_DEPRECATED_EXPORT
|
||||||
if decl[1].strip() != keyword: continue
|
if decl[1].strip() != keyword: continue
|
||||||
|
|
||||||
|
content = ''
|
||||||
if this_file != current_file:
|
if this_file != current_file:
|
||||||
ret += '\n// ' + this_file + '\n'
|
content += '\n// ' + this_file + '\n'
|
||||||
current_file = this_file;
|
current_file = this_file;
|
||||||
decl = decl[0] + ' ' + decl[2]
|
decl = decl[0] + ' ' + decl[2]
|
||||||
if not decl.endswith(';'): decl += ';'
|
if not decl.endswith(';'): decl += ';'
|
||||||
ret += decl + '\n'
|
content += decl + '\n'
|
||||||
return ret
|
if 'kademlia' in this_file:
|
||||||
|
dht_ret += content
|
||||||
|
else:
|
||||||
|
ret += content
|
||||||
|
|
||||||
|
if dht_ret == '':
|
||||||
|
return ret
|
||||||
|
else:
|
||||||
|
return ret + '\nnamespace dht {\n' + dht_ret + '\n}\n'
|
||||||
|
|
||||||
os.remove('include/libtorrent/fwd.hpp')
|
os.remove('include/libtorrent/fwd.hpp')
|
||||||
with open('include/libtorrent/fwd.hpp', 'w+') as f:
|
with open('include/libtorrent/fwd.hpp', 'w+') as f:
|
||||||
|
|
Loading…
Reference in New Issue