c2hs
c2hs copied to clipboard
c2hs is a pre-processor for Haskell FFI bindings to C libraries
``` $ c2hs external/c2hs_repo/Baz.chs -o out//Baz.hs --cpp /usr/bin/cpp -C-includeghcplatform.h -C-includeghcversion.h -C-iquote clang: error: no input files ``` Seems Darwin's `cpp` is behaving similar to the "openbsd" variant regarding the `-xc`...
I am producing bindings for `libsodium`, and especially the [following struct](https://github.com/jedisct1/libsodium/blob/07c2f6c053dd2aed1716444d667dcc781f14739c/src/libsodium/include/sodium/crypto_generichash_blake2b.h#L25): ```c #ifndef CRYPTO_ALIGN # if defined(__INTEL_COMPILER) || defined(_MSC_VER) # define CRYPTO_ALIGN(x) __declspec(align(x)) # else # define CRYPTO_ALIGN(x) __attribute__ ((aligned(x)))...
According to this [blog post](https://www.haskell.org/ghc/blog/20210709-capi-usage.html), the `capi` calling convention added with the [CApiFFI](https://downloads.haskell.org/ghc/9.0.1/docs/html/users_guide/exts/ffi.html?highlight=capiffi#extension-CApiFFI) language extension results in more portable code. I don't see a way to use `capi` instead of...
While attempting to depend on the `ncurses` package, build fails with: ``` Configuring ncurses-0.2.16... Preprocessing library for ncurses-0.2.16.. c2hs: C header contains errors: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/time.h:198: (column 23) [ERROR] >>> Syntax error...
I fixed a bunch of warnings here and there(thrown at me by a recent ghc). I was going to move this whole thing to a more recent version of cabal,...
Haddock comments in `#fun` commands are passed on to the generated file, so that imported function arguments can be documented. Is it possible to do the same for imported `enum`s?...
The tarball for version 0.28.8 lacks two directories with test data, which are present in this git repository: - tests/bugs/issue-242 - tests/system/interruptible Would it be possible to add them in...
``` glib> Configuring glib-0.13.8.0... glib> build glib> Preprocessing library for glib-0.13.8.0.. glib> setup: Error in C header file. glib> glib> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/time.h:154: (column 17) [FATAL] glib> >>> Syntax error! glib> The...
c2hs requires `language-c >=0.7.1 && =0.7.1 &&
http://www.cse.unsw.edu.au/~chak/papers/papers.html#c2hs It's linked in wiki: https://github.com/haskell/c2hs/wiki/User-Guide https://github.com/haskell/c2hs/wiki/Implementation-of-Haskell-Binding-Modules