Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build with system cmark-gfm (fixes #8) #9

Merged
merged 1 commit into from
Aug 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CMarkGFM.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ ensurePluginsRegistered = c_core_extensions_ensure_registered

-- | Frees a cmark linked list, produced by extsToLlist.
freeLlist :: LlistPtr a -> IO ()
freeLlist = c_cmark_llist_free c_CMARK_DEFAULT_MEM_ALLOCATOR
freeLlist = c_cmark_llist_free c_cmark_mem

-- | Converts a list of resolved extension pointers to a single cmark
-- linked list, which can be passed to functions requiring a list of
Expand All @@ -67,7 +67,7 @@ extsToLlist :: [ExtensionPtr] -> IO (LlistPtr ExtensionPtr)
extsToLlist [] = return nullPtr
extsToLlist (h:t) = do
t' <- extsToLlist t
c_cmark_llist_append c_CMARK_DEFAULT_MEM_ALLOCATOR t' (castPtr h)
c_cmark_llist_append c_cmark_mem t' (castPtr h)

-- | Resolves CMarkExtensions to pointers.
resolveExts :: [CMarkExtension] -> IO [ExtensionPtr]
Expand Down Expand Up @@ -633,8 +633,8 @@ foreign import ccall "cmark.h cmark_llist_append"
foreign import ccall "cmark.h cmark_llist_free"
c_cmark_llist_free :: MemPtr -> LlistPtr a -> IO ()

foreign import ccall "cmark.h &CMARK_DEFAULT_MEM_ALLOCATOR"
c_CMARK_DEFAULT_MEM_ALLOCATOR :: MemPtr
foreign import ccall "cmark.h cmark_get_default_mem_allocator"
c_cmark_mem :: MemPtr

foreign import ccall "cmark_extension_api.h cmark_parser_attach_syntax_extension"
c_cmark_parser_attach_syntax_extension :: ParserPtr -> ExtensionPtr -> IO ()
Expand Down
2 changes: 1 addition & 1 deletion cmark-gfm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ library
default-language: Haskell2010
ghc-options: -Wall -fno-warn-unused-do-bind
if flag(pkgconfig)
pkgconfig-depends: libcmark-gfm
Extra-Libraries: cmark-gfm cmark-gfmextensions
else
cc-options: -Wall -std=c99
Include-dirs: cbits
Expand Down