Skip to content

compile with ghc 6.12.3 #5

Open
wants to merge 1 commit into from

2 participants

@markwright

Please review it very carefully and let me know where its broken so I can fix it. I can rebase the pull request to fix it. Currently it makes it compile but I have little confidence that its correct.

@phonohawk
Owner

Thanks, I'll have a look at it. Let me take some time for that.

@phonohawk phonohawk commented on the diff Dec 5, 2011
OpenSSL/EVP/Internal.hsc
mask_ $ do
withForeignPtr ctx _cipher_ctx_init
addForeignPtrFinalizer _cipher_ctx_cleanup ctx
return $ CipherCtx ctx
+#else
+ block $ do
+ withForeignPtr ctx _cipher_ctx_init
+ addForeignPtrFinalizer _cipher_ctx_cleanup ctx
+ unblock $ return $ CipherCtx ctx
@phonohawk
Owner
phonohawk added a note Dec 5, 2011

Do we really need 'unblock' in the last line?

return $ CipherCtx ctx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@phonohawk phonohawk commented on the diff Dec 5, 2011
OpenSSL/EVP/Internal.hsc
mask_ $ do
withForeignPtr ctx _md_ctx_init
addForeignPtrFinalizer _md_ctx_cleanup ctx
return $ DigestCtx ctx
+#else
+ block $ do
+ withForeignPtr ctx _md_ctx_init
+ addForeignPtrFinalizer _md_ctx_cleanup ctx
+ unblock $ return $ DigestCtx ctx
@phonohawk
Owner
phonohawk added a note Dec 5, 2011

Likewise.

return $ DigestCtx ctx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@phonohawk phonohawk commented on the diff Dec 5, 2011
OpenSSL/EVP/Internal.hsc
createPKey f = mask $ \restore -> do
ptr <- _pkey_new >>= failIfNull
(restore $ f ptr >> return ()) `onException` _pkey_free' ptr
wrapPKeyPtr ptr
+#else
+createPKey f = block $ do
+ ptr <- _pkey_new >>= failIfNull
+ (f ptr >> return ()) `onException` _pkey_free' ptr
+ unblock $ wrapPKeyPtr ptr
@phonohawk
Owner
phonohawk added a note Dec 5, 2011

Shouldn't this be something like this?

createPKey f = block $ do
  ptr <- _pkey_new >>= failIfNull
  (unblock $ f ptr >> return ()) `onException` _pkey_free' ptr
  wrapPKeyPtr ptr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@phonohawk
Owner

I reviewed your patch and found some changes that don't look identical to the original code.
Could you take a look at them?
(Sorry for being late.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.