Commit b2accddf authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

winspool: Simplify cups function loading.

parent 7af7c786
......@@ -469,12 +469,19 @@ static BOOL add_printer_driver(WCHAR *name)
}
#ifdef SONAME_LIBCUPS
static typeof(cupsFreeDests) *pcupsFreeDests;
static typeof(cupsGetDests) *pcupsGetDests;
static typeof(cupsGetPPD) *pcupsGetPPD;
static typeof(cupsPrintFile) *pcupsPrintFile;
static void *cupshandle;
#define CUPS_FUNCS \
DO_FUNC(cupsFreeDests); \
DO_FUNC(cupsGetDests); \
DO_FUNC(cupsGetPPD); \
DO_FUNC(cupsPrintFile);
#define DO_FUNC(f) static typeof(f) *p##f
CUPS_FUNCS;
#undef DO_FUNC
static BOOL CUPS_LoadPrinters(void)
{
int i, nrofdests;
......@@ -493,15 +500,9 @@ static BOOL CUPS_LoadPrinters(void)
}
TRACE("%p: %s loaded\n", cupshandle, SONAME_LIBCUPS);
#define DYNCUPS(x) \
p##x = wine_dlsym(cupshandle, #x, NULL,0); \
if (!p##x) return FALSE;
DYNCUPS(cupsFreeDests);
DYNCUPS(cupsGetPPD);
DYNCUPS(cupsGetDests);
DYNCUPS(cupsPrintFile);
#undef DYNCUPS
#define DO_FUNC(x) p##x = wine_dlsym( cupshandle, #x, NULL, 0 ); if (!p##x) return FALSE;
CUPS_FUNCS;
#undef DO_FUNC
if(RegCreateKeyW(HKEY_LOCAL_MACHINE, PrintersW, &hkeyPrinters) !=
ERROR_SUCCESS) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment