From a71897f482e5ed7cfdb5c7385202e87e50314e33 Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Sun, 10 Jun 2012 12:42:41 +0200 Subject: [PATCH] cec: open libcec.so.1 instead of libcec.so in cecloader.h. credits @coling. github issue #30. cosmetics: dlerror() already shows the name of the lib it tried to load. removed dupe log entry --- include/cecloader.h | 24 ++++++------------------ include/cectypes.h | 1 + 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/include/cecloader.h b/include/cecloader.h index 5d4361d..7a7dce6 100644 --- a/include/cecloader.h +++ b/include/cecloader.h @@ -159,15 +159,11 @@ CEC::ICECAdapter *LibCecInit(const char *strDeviceName, CEC::cec_device_type_lis #if defined(__APPLE__) g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY); #else - g_libCEC = dlopen(strLib ? strLib : "libcec.so", RTLD_LAZY); + g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY); #endif if (!g_libCEC) { -#if defined(__APPLE__) - cout << "cannot find " << (strLib ? strLib : "libcec.dylib") << dlerror() << endl; -#else - cout << "cannot find " << (strLib ? strLib : "libcec.so") << dlerror() << endl; -#endif + cout << dlerror() << endl; return NULL; } } @@ -196,15 +192,11 @@ CEC::ICECAdapter *LibCecInitialise(CEC::libcec_configuration *configuration, con #if defined(__APPLE__) g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY); #else - g_libCEC = dlopen(strLib ? strLib : "libcec.so", RTLD_LAZY); + g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY); #endif if (!g_libCEC) { -#if defined(__APPLE__) - cout << "cannot find " << (strLib ? strLib : "libcec.dylib") << dlerror() << endl; -#else - cout << "cannot find " << (strLib ? strLib : "libcec.so") << dlerror() << endl; -#endif + cout << dlerror() << endl; return NULL; } } @@ -246,15 +238,11 @@ bool LibCecBootloader(const char *strLib = NULL) #if defined(__APPLE__) g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY); #else - g_libCEC = dlopen(strLib ? strLib : "libcec.so", RTLD_LAZY); + g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY); #endif if (!g_libCEC) { -#if defined(__APPLE__) - cout << "cannot find " << (strLib ? strLib : "libcec.dylib") << dlerror() << endl; -#else - cout << "cannot find " << (strLib ? strLib : "libcec.so") << dlerror() << endl; -#endif + cout << dlerror() << endl; return NULL; } } diff --git a/include/cectypes.h b/include/cectypes.h index 72295ad..b5ae1ec 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -112,6 +112,7 @@ namespace CEC { #define CEC_MIN_LIB_VERSION 1 #define CEC_LIB_VERSION_MAJOR 1 +#define CEC_LIB_VERSION_MAJOR_STR "1" #define CEC_LIB_VERSION_MINOR 7 typedef enum cec_abort_reason -- 2.34.1