Closed trofi closed 7 years ago
I'm fine with most of these, except the SKIP_NON_CROSSCOMPILABLE
changes. Ideally a cross-compiled version of Win32 shouldn't contain any limitations.
That said, I don't know why the casts are needed in those enums. I think they can just be treated as a normal int and have a wrapper around castUINTPtrToPtr
that casts it from an int to a pointer.
I agree SKIP_NON_CROSSCOMPILABLE
is not something pretty and needs more thought. At worst hard-coding integer numbers as they appear in windows.h
.
Should I drop this patch from this series or submit 3 pull requests for rest of patches?
I don't actually know why these resource ids need to be pointer types. I'll have to take a closer look.
If you could drop that part from the patch I'll accept the rest.
Repushed into master branch without SKIP_NON_CROSSCOMPILABLE
commit.
Thanks, how do I test the cross compile btw? I'd be happy to add it to the the ci.
To enable cross-mode on native windows machine it should be enough to run:
$ cabal configure --hsc2hs-options='--cross-safe --cross-compile'
$ cabal build
If you already have a ghc cross-compiler that targets windows you can use that:
$ cabal configure \
--with-ghc=$HOME/dev/git/ghc-w32/inplace/bin/ghc-stage1 \
--hsc2hs-options='--cross-safe --cross-compile' \
--flags=crosscompile
$ cabal build
But be careful: it takes very long time to run hsc2hs. Something in order of few hours.
Filed a separate issue on dropped patch to deal with pointer-constants: https://github.com/haskell/win32/issues/88
Note that this PR has to work around two current
hsc2hs
issues: Trac #13619 and Trac #13620.