-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable compatibility with libconfig older than v1.5 #157
Conversation
…e shipped with RHEL/CentOS 7)
Thanks, I didn't know this was incompatible with older versions. |
This PR broke compatibility with Ubuntu 18.04:
|
@abraha2d I'm looking at libconfig 1.4.9 on the CentOS repos and it appears that it does have support for .lookup(). Can you post the errors you were getting when compiling before this PR? Also, because of bug #158, I'm going to have to revert this change. |
This is the error I was encountering:
|
libconfig v1.4.9 has Config.lookup(), but it does not have Setting.lookup(). Setting.lookup() was added in v1.5 to unify the lookup API between Config and Setting: hyperrealm/libconfig@1ff9b7f. The issue that's occurring with my PR is a mismatch between |
Alright, thanks. |
I committed a fix over on abraha2d/logiops, but I don't currently have access to an Ubuntu system to verify that it fixes the issue... It compiles fine on RHEL 7 with GCC 9.3.1. diff --git a/src/logid/features/ThumbWheel.cpp b/src/logid/features/ThumbWheel.cpp
index 5e00926..0017080 100644
--- a/src/logid/features/ThumbWheel.cpp
+++ b/src/logid/features/ThumbWheel.cpp
@@ -227,7 +227,7 @@ std::shared_ptr<actions::Action> ThumbWheel::Config::_genAction(Device* dev,
libconfig::Setting& config_root, const std::string& name)
{
try {
- auto& a_group = config_root[name];
+ auto& a_group = config_root[name.c_str()];
try {
return actions::Action::makeAction(dev, a_group);
} catch(actions::InvalidAction& e) {
@@ -244,7 +244,7 @@ std::shared_ptr<actions::Gesture> ThumbWheel::Config::_genGesture(Device* dev,
libconfig::Setting& config_root, const std::string& name)
{
try {
- auto& g_group = config_root[name];
+ auto& g_group = config_root[name.c_str()];
try {
auto g = actions::Gesture::makeGesture(dev, g_group);
if(g->wheelCompatibility()) { |
@ightnapovial Could you test out the fix on https://github.com/abraha2d/logiops? |
fwiw I was able to test that it compiles successfully on KDE neon 5.19 (based on Ubuntu 18.04) with GCC 10.1.0. |
libconfig v1.4.9 is the latest version available in the RHEL / CentOS 7 repos, but
Setting.lookup()
was only added in v1.5.This PR allows logiops to be compiled on these operating systems.