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

Alexandre Julliard julliard at winehq.org
Fri May 16 12:13:57 CDT 2014


Module: wine
Branch: master
Commit: 3f6c6dbbb3d44fe72388b03bd49a0daad6463f9c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3f6c6dbbb3d44fe72388b03bd49a0daad6463f9c

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri May 16 11:34:37 2014 +0200

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

---

 dlls/sane.ds/sane_main.c |   14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

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




More information about the wine-cvs mailing list