New syntax support, backwards compat cpp for ghcjs#757
Conversation
- Javascript conventions have changed slightly with the GHC Javascript backend (from GHCJS). - See https://github.com/ghcjs/ghcjs-base/pull/135/files. - Update foreign imports to match these new conventions, so compiling with GHC Javascript backend works.
- Update canvas2d to work with new JS backend syntax.
| , div_ [] [ text info ] | ||
| ] | ||
|
|
||
| #ifndef ghcjs_HOST_OS |
There was a problem hiding this comment.
@dmjio
This is defined both for ghcjs and ghc's js backend.
You want something like this
https://github.com/ghcjs/jsaddle/blob/b72b4d01fdc186d2c7447beb7273ad13358ff593/jsaddle/src/Language/Javascript/JSaddle/Exception.hs#L21-L29
There was a problem hiding this comment.
@alexfmpe where do you see ghcjs_HOST_OS defined for the new JS backend?
Also, have people on both GHCJS and on >= GHC 9.0.0, so this might explain some issues I was seeing.
There was a problem hiding this comment.
There was a problem hiding this comment.
@alexfmpe where do you see ghcjs_HOST_OS defined for the new JS backend?
Hmm? AFAICT cabal considers it os(ghcjs) for both old ghcjs and new js backend https://hackage.haskell.org/package/Cabal-syntax-3.14.1.0/docs/Distribution-System.html#v:Ghcjs
unlike impl(ghcjs)
https://hackage.haskell.org/package/Cabal-syntax-3.14.1.0/docs/Distribution-Compiler.html#v:GHCJS
Brings in #740, adds CPP for ghcjs.