Additional minor fixes to Linux build
This commit is contained in:
@@ -117,7 +117,7 @@ public:
|
||||
if(getSupportedHandlers().count(t) == 0) throw xHandlerNotSupported(t);
|
||||
auto old_handler = event_handlers[t];
|
||||
if(handler) event_handlers[t] = handler;
|
||||
else event_handlers[t].clear();
|
||||
else event_handlers[t] = nullptr;
|
||||
if(old_handler.empty()) return nullptr;
|
||||
return boost::any_cast<typename event_fcn<t>::type>(old_handler);
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ void append_iarray_pref(std::string keypath, int value) {
|
||||
if(prefs.find(keypath) == prefs.end() || prefs[keypath].type() != typeid(iarray))
|
||||
prefs[keypath] = iarray{value};
|
||||
else {
|
||||
iarray& arr = boost::any_cast<iarray>(prefs[keypath]);
|
||||
iarray& arr = boost::any_cast<iarray&>(prefs[keypath]);
|
||||
arr.push_back(value);
|
||||
prefs[keypath] = arr;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ static bool save_prefs(fs::path fpath) {
|
||||
std::ofstream fout(fpath.string().c_str());
|
||||
for(auto& kv : prefs) {
|
||||
if(kv.second.type() == typeid(iarray)) {
|
||||
iarray& arr = boost::any_cast<iarray>(kv.second);
|
||||
iarray& arr = boost::any_cast<iarray&>(kv.second);
|
||||
fout << kv.first << " = [";
|
||||
for(int i : arr) fout << i << ' ';
|
||||
fout.seekp(-1,std::ios::cur); // To overwrite the final space written in the loop
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include <cstdio>
|
||||
#include <ctime>
|
||||
#include <cstring>
|
||||
#include <stdexcept>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// For some bizarre reason, Visual Studio doesn't declare snprintf in <cstdio>
|
||||
|
Reference in New Issue
Block a user