diff options
author | Simon Marlow <marlowsd@gmail.com> | 2010-03-29 15:42:20 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2010-03-29 15:42:20 +0000 |
commit | 3891512c4c770dadd0372ad84d2dec72b34652d2 (patch) | |
tree | a41066cd7c1b6cecdbe81f1f562d5381b99231f9 /compiler/main/CodeOutput.lhs | |
parent | 569880390c3d9c4d1c5ae748471f37fe5ff8e4db (diff) | |
download | haskell-3891512c4c770dadd0372ad84d2dec72b34652d2.tar.gz |
fix return type cast in f.i.wrapper when using libffi (#3516)
Original fix submitted by
Sergei Trofimovich <slyfox@community.haskell.org>
modified by me:
- exclude 64-bit types
- compare uniques, not strings
- #include "ffi.h" is conditional
Diffstat (limited to 'compiler/main/CodeOutput.lhs')
-rw-r--r-- | compiler/main/CodeOutput.lhs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/main/CodeOutput.lhs b/compiler/main/CodeOutput.lhs index 2d68b830ec..83f23cfbc3 100644 --- a/compiler/main/CodeOutput.lhs +++ b/compiler/main/CodeOutput.lhs @@ -27,6 +27,7 @@ import Util import Cmm ( RawCmm ) import HscTypes import DynFlags +import Config import ErrUtils ( dumpIfSet_dyn, showPass, ghcExit ) import Outputable @@ -225,6 +226,10 @@ outputForeignStubs dflags mod location stubs concatMap mk_include (includes rts_pkg) mk_include i = "#include \"" ++ i ++ "\"\n" + -- wrapper code mentions the ffi_arg type, which comes from ffi.h + ffi_includes | cLibFFI = "#include \"ffi.h\"\n" + | otherwise = "" + stub_h_file_exists <- outputForeignStubs_help stub_h stub_h_output_w ("#include \"HsFFI.h\"\n" ++ cplusplus_hdr) cplusplus_ftr @@ -237,6 +242,7 @@ outputForeignStubs dflags mod location stubs ("#define IN_STG_CODE 0\n" ++ "#include \"Rts.h\"\n" ++ rts_includes ++ + ffi_includes ++ cplusplus_hdr) cplusplus_ftr -- We're adding the default hc_header to the stub file, but this |