Fix #3741, simplifying things in the process
[ghc-hetmet.git] / rts / RtsDllMain.c
index af3c509..3e5af68 100644 (file)
@@ -15,8 +15,7 @@
 #endif
 
 /* I'd be mildly surprised if this wasn't defined, but still. */
-#ifdef ENABLE_WIN32_DLL_SUPPORT
-
+#if defined(__PIC__) && defined(mingw32_TARGET_OS)
 BOOL
 WINAPI
 DllMain ( HINSTANCE hInstance
@@ -31,9 +30,13 @@ DllMain ( HINSTANCE hInstance
    *       you pass to the RTS.
    */
   switch (reason) {
-  case DLL_PROCESS_DETACH: shutdownHaskell();
+  
+  // shutdownHaskelAndExit() is already being called,
+  //   so I don't think we need this. BL 2009/11/17
+  //case DLL_PROCESS_DETACH: shutdownHaskell();
   }
   return TRUE;
 }
 
-#endif /* ENABLE_WIN32_DLL_SUPPORT */
+#endif /* defined(__PIC__) && defined(mingw32_TARGET_OS) */