-exitWith code@(ExitFailure n)
- | n == 0 = ioException (IOError Nothing InvalidArgument "exitWith" "ExitFailure 0" Nothing)
- | otherwise = throw (ExitException code)
+exitWith code@(ExitFailure n)
+ | n /= 0 = throw (ExitException code)
+#ifdef __GLASGOW_HASKELL__
+ | otherwise = ioError (IOError Nothing InvalidArgument "exitWith" "ExitFailure 0" Nothing)
+#endif
+#endif /* ! __NHC__ */