Fix Link Time Optimizations

This commit fixes compiling rTorrent with LTO (Link Time Optimizations). We just need to rename from variables in the directory_entry structure to avoid ODR and ZLIB conflicts.
This commit is contained in:
stickz
2024-09-01 08:20:01 -04:00
parent 4e246a401f
commit ea3828a17e
7 changed files with 29 additions and 29 deletions
+6 -6
View File
@@ -76,11 +76,11 @@ PathInput::pressed(int key) {
struct _transform_filename {
void operator () (utils::directory_entry& entry) {
#ifdef __sun__
if (entry.d_type & S_IFDIR)
if (entry.s_type & S_IFDIR)
#else
if (entry.d_type == DT_DIR)
if (entry.s_type == DT_DIR)
#endif
entry.d_name += '/';
entry.s_name += '/';
}
};
@@ -105,7 +105,7 @@ PathInput::receive_do_complete() {
if (r.first == r.second)
return; // Show some nice colors here.
std::string base = rak::make_base<std::string>(r.first, r.second, rak::const_mem_ref(&utils::directory_entry::d_name));
std::string base = rak::make_base<std::string>(r.first, r.second, rak::const_mem_ref(&utils::directory_entry::s_name));
// Clear the path after the cursor to make this code cleaner. It's
// not really nessesary to add the complexity just because someone
@@ -142,12 +142,12 @@ PathInput::find_last_delim() {
inline bool
find_complete_compare(const utils::directory_entry& complete, const std::string& base) {
return complete.d_name.compare(0, base.size(), base);
return complete.s_name.compare(0, base.size(), base);
}
inline bool
find_complete_not_compare(const utils::directory_entry& complete, const std::string& base) {
return !complete.d_name.compare(0, base.size(), base);
return !complete.s_name.compare(0, base.size(), base);
}
PathInput::range_type