hsc2hs

A preprocessor that helps with writing Haskell bindings to C code

Version on this page:0.68.10@rev:1
LTS Haskell 22.39:0.68.10@rev:2
Stackage Nightly 2024-10-31:0.68.10@rev:3
Latest on Hackage:0.68.10@rev:3

See all snapshots hsc2hs appears in

BSD-3-Clause licensed by Marcin Kowalczyk
Maintained by [email protected]
This version can be pinned in stack with:hsc2hs-0.68.10@sha256:488cca2a179a5141da8f35a3a7e6699a0ef690f834f589d6b152c4947aa8fe2d,3013

Module documentation for 0.68.10

There are no documented modules for this package.

The hsc2hs program can be used to automate some parts of the process of writing Haskell bindings to C code. It reads an almost-Haskell source file with embedded special constructs, and outputs a real Haskell file with these constructs processed, based on information taken from some C headers. The extra constructs provide Haskell counterparts of C types, values of C constants, including sizes of C types, and access to fields of C structs.

For more details, see the hsc2hs section in the GHC User's Guide.

Changes

0.68.10

  • Further improve robustness of detection of pointer types in --cross mode.

  • Compatibility with new base versions

0.68.9

  • Improve robustness of detection of pointer types in --cross mode.

0.68.8

  • Process flags in order, now the last of --compiler, --linker, --template is used. (#35)

  • WINIO: Make sure that with we don’t use the TEMP workaround (#52)

0.68.7

  • The C compiler is now assumed to be called cc instead of gcc by default (#42)

  • Fix race condition when using response files (#30)

  • Add extra diagnostics when hsc2hs sub-process fails and make TempFile creation fully atomic on Windows. See (#33)

0.68.6

  • Supports generation of response files to avoid system filepath limits (#22, #23)

  • Fix non-deterministic failures for response file handlings (#29)

  • Temporary file removals on Windows are not a bit more reliable and should throw less access denied errors. See #25 and (#9775)

  • Accept a leading single quote for data constructor promotion (#13, #17)

  • Support MonadFail / base-4.13

  • Include template file as first header in hsc2hs generated C file (#28)

  • On Windows define __USE_MINGW_ANSI_STDIO to 1 instead of 0 when not already defined in standard template header. This is a more modern default (#28)

0.68.5

  • Support response files regardless of which GHC hsc2hs was compiled with (#15758)

  • Support for non-x86 platforms should be significantly more robust due to improvements in hsc2hs’s assembly parser

  • Add support for haskell files that use a leading single quote for promoted data constructors.

0.68.4

  • Add support to read command line arguments supplied via response files (#13896)

0.68.2

  • Support GHC 8.2.1

  • Make hsc_alignment macro work in clang (D3346)

  • Track column numbers to improve GHC’s caret diagnostic display (#13388)

0.68.1

  • Fix type signature of generated main test function to avoid C compiler warnings about unused argc/argv function parameters during feature testing.

  • Double-escape paths used to build call to hsc_line (#12504)