From: Lars Op den Kamp Date: Sun, 10 Jun 2012 10:42:41 +0000 (+0200) Subject: cec: open libcec.so.1 instead of libcec.so in cecloader.h. credits @coling. github... X-Git-Tag: upstream/2.2.0~1^2~23^2^2~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=a71897f482e5ed7cfdb5c7385202e87e50314e33;p=deb_libcec.git 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 --- 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