Skip to content

Commit 96aa588

Browse files
Add LibC (WIP)
This commit includes the "easy" types. Once merged, we can start work on integrating using of the library while simultaneously filling in the details. Notes: * The `x86_64` architecture `Arch` module is put in place, though no architecture-specific types that require it are implemented yet. TODO comments marked "`arch`" need to be implemented in `Arch` modules. * As decided on in our last call, integral types with a specific bit width are implemented using corresponding Haskell types. This allows them to be implemented in general, not in `Arch` modules. * Documentation indicates that `stdint.h` should define types `int_fast8_t`, `int_fast16_t`, `int_fast32_t`, and `int_fast64_t` (as well as the unsigned versions), but Musl does *not* define `int_fast16_t` or `int_fast32_t` (or the unsigned versions). I went ahead and implemented them in the module anyway. * No types from `stdatomic.h`, `stdbit.h`, or `stdckdint.h` are implemented yet. These are not (yet) supported by Musl. * The types implemented use names that match those in `base`. I can rename them to use our default name mangling rules if we decide to do that instead. I did not implement any structures or enumerations yet; I will do so once we decide on naming.
1 parent 3ad4ca4 commit 96aa588

File tree

3 files changed

+922
-1
lines changed

3 files changed

+922
-1
lines changed

hs-bindgen-patterns/hs-bindgen-patterns.cabal

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,20 @@ library
3434
import:
3535
lang
3636
exposed-modules:
37-
HsBindgen.Patterns
3837
HsBindgen.ConstantArray
38+
HsBindgen.Patterns
39+
HsBindgen.Patterns.LibC
3940
other-modules:
4041
HsBindgen.Patterns.Arithmetic
4142
HsBindgen.Patterns.Backtrace
4243
HsBindgen.Patterns.Enum.Bitfield
4344
HsBindgen.Patterns.Enum.Simple
45+
HsBindgen.Patterns.LibC.Arch
4446
hs-source-dirs:
4547
src
48+
if arch(x86_64)
49+
hs-source-dirs:
50+
src-x86_64
4651
build-depends:
4752
, pretty-show >= 1.10 && < 1.11
4853
, vector ^>=0.13.2.0
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module HsBindgen.Patterns.LibC.Arch (
2+
) where

0 commit comments

Comments
 (0)