Remove native win32 support. We have no report that LCDproc can be natively
compiled and used with recent Windows systems (Windows Vista/7). Except for serial drivers (and those using USB->serial adapters) drivers are not expected to work with those systems.
This commit is contained in:
+2
-32
@@ -14,12 +14,8 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#ifndef WIN32
|
||||
# include <errno.h>
|
||||
# include <dlfcn.h>
|
||||
#else
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@@ -219,20 +215,10 @@ driver_bind_module(Driver *driver)
|
||||
debug(RPT_DEBUG, "%s(driver=[%.40s])", __FUNCTION__, driver->name);
|
||||
|
||||
/* Load the module */
|
||||
#ifndef WIN32
|
||||
driver->module_handle = dlopen(driver->filename, RTLD_NOW);
|
||||
#else
|
||||
driver->module_handle = LoadLibraryEx((driver->filename), NULL, 0);
|
||||
#endif
|
||||
if (driver->module_handle == NULL) {
|
||||
#ifndef WIN32
|
||||
report(RPT_ERR, "Could not open driver module %.40s: %s",
|
||||
driver->filename, dlerror());
|
||||
#else
|
||||
/* REVISIT: replace dlerror() */
|
||||
report(RPT_ERR, "Could not open driver module %.40s.",
|
||||
driver->filename);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -249,21 +235,13 @@ driver_bind_module(Driver *driver)
|
||||
strcpy(s, *(driver->symbol_prefix));
|
||||
strcat(s, driver_symbols[i].name);
|
||||
debug(RPT_DEBUG, "%s: finding symbol: %s", __FUNCTION__, s);
|
||||
#ifndef WIN32
|
||||
*p = dlsym(driver->module_handle, s);
|
||||
#else
|
||||
*p = (void(*)()) (GetProcAddress(driver->module_handle, s));
|
||||
#endif
|
||||
free(s);
|
||||
}
|
||||
/* 2) try to retrieve the symbol without the symbol prefix */
|
||||
if (*p == NULL) {
|
||||
debug(RPT_DEBUG, "%s: finding symbol: %s", __FUNCTION__, driver_symbols[i].name);
|
||||
#ifndef WIN32
|
||||
*p = dlsym(driver->module_handle, driver_symbols[i].name);
|
||||
#else
|
||||
*p = (void(*)()) (GetProcAddress(driver->module_handle, driver_symbols[i].name));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (*p != NULL) {
|
||||
@@ -283,11 +261,7 @@ driver_bind_module(Driver *driver)
|
||||
if (missing_symbols > 0) {
|
||||
report(RPT_ERR, "Driver [%.40s] misses %d required symbols",
|
||||
driver->name, missing_symbols);
|
||||
#ifndef WIN32
|
||||
dlclose(driver->module_handle);
|
||||
#else
|
||||
FreeLibrary(driver->module_handle);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -325,11 +299,7 @@ driver_unbind_module(Driver *driver)
|
||||
{
|
||||
debug(RPT_DEBUG, "%s(driver=[%.40s])", __FUNCTION__, driver->name);
|
||||
|
||||
#ifndef WIN32
|
||||
dlclose(driver->module_handle);
|
||||
#else
|
||||
FreeLibrary(driver->module_handle);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user