sane.ds: Remove unnecessary DllMain implementation when SANE is missing.

This commit is contained in:
Alexandre Julliard 2014-05-16 11:34:37 +02:00
parent 78cf6059bc
commit 3f6c6dbbb3
1 changed files with 4 additions and 10 deletions

View File

@ -30,10 +30,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(twain); WINE_DEFAULT_DEBUG_CHANNEL(twain);
HINSTANCE SANE_instance;
#ifdef SONAME_LIBSANE #ifdef SONAME_LIBSANE
HINSTANCE SANE_instance;
static void *libsane_handle; static void *libsane_handle;
static void close_libsane(void *h) static void close_libsane(void *h)
@ -79,8 +79,6 @@ static void *open_libsane(void)
return h; return h;
} }
#endif /* SONAME_LIBSANE */
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{ {
TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved); TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved);
@ -88,7 +86,6 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
switch (fdwReason) switch (fdwReason)
{ {
case DLL_PROCESS_ATTACH: { case DLL_PROCESS_ATTACH: {
#ifdef SONAME_LIBSANE
SANE_Int version_code; SANE_Int version_code;
libsane_handle = open_libsane(); libsane_handle = open_libsane();
@ -96,28 +93,25 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return FALSE; return FALSE;
psane_init (&version_code, NULL); psane_init (&version_code, NULL);
#endif
SANE_instance = hinstDLL; SANE_instance = hinstDLL;
DisableThreadLibraryCalls(hinstDLL); DisableThreadLibraryCalls(hinstDLL);
break; break;
} }
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
if (lpvReserved) break; if (lpvReserved) break;
#ifdef SONAME_LIBSANE
TRACE("calling sane_exit()\n"); TRACE("calling sane_exit()\n");
psane_exit (); psane_exit ();
close_libsane(libsane_handle); close_libsane(libsane_handle);
#endif
break; break;
} }
return TRUE; return TRUE;
} }
#ifdef SONAME_LIBSANE
static TW_UINT16 SANE_GetIdentity( pTW_IDENTITY, pTW_IDENTITY); static TW_UINT16 SANE_GetIdentity( pTW_IDENTITY, pTW_IDENTITY);
static TW_UINT16 SANE_OpenDS( pTW_IDENTITY, pTW_IDENTITY); static TW_UINT16 SANE_OpenDS( pTW_IDENTITY, pTW_IDENTITY);
#endif
#endif /* SONAME_LIBSANE */
static TW_UINT16 SANE_SourceControlHandler ( static TW_UINT16 SANE_SourceControlHandler (
pTW_IDENTITY pOrigin, pTW_IDENTITY pOrigin,