haskell - Exporting CPP Macros -
haskell - Exporting CPP Macros -
i'm hacking around else's code. have several macros defined in .h
file (no code, macros), , these macros used in several haskell files. i'm missing step allows compilation. when seek compile haskell file, errors on missing/undefined macros. there ghc alternative utilize macros defined in header file? i'm trying same ghci.
i did effort rename .h
file .hs
, import in files utilize macros, apparently not allowed export macros (and not exported automatically).
how can utilize these macros when compiling ghc(i)?
add cpp pragma top of haskell file , add together #include foo.h
line haskell file. c preprocessor expand macros you.
see [1] options -dsymbol=value
define macro files compiled invocation of ghc
.
[1] https://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html
haskell ghc
Comments
Post a Comment