From 98aa98f57b3ac0e03b3503824c66db22704d592c Mon Sep 17 00:00:00 2001 From: Richard Cook Date: Thu, 18 Aug 2016 21:55:07 -0700 Subject: [PATCH] Refs #4: Workaround for invalid path generation in hsc2hs/inline-c on Windows This is a temporary hack to work around the invalid output paths generated by inline-c on Windows platforms: when hsc2hs and inline-c are used together in the same source file under Windows, Template Haskell yields source file names with all backslashes removed. See: https://github.com/fpco/inline-c/issues/50 https://ghc.haskell.org/trac/ghc/ticket/12504 --- .gitignore | 1 + clang-pure.cabal | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6a120de..8a9a3ac 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ dist/ src/**/*.c .cabal-sandbox .stack-work +srcLanguageCClangInternalFFI.c \ No newline at end of file diff --git a/clang-pure.cabal b/clang-pure.cabal index 8ca08fa..7b6f890 100644 --- a/clang-pure.cabal +++ b/clang-pure.cabal @@ -53,7 +53,10 @@ library hs-source-dirs: src/ build-tools: hsc2hs default-language: Haskell2010 - c-sources: src/Language/C/Clang/Internal/FFI.c + if os(windows) + c-sources: srcLanguageCClangInternalFFI.c + else + c-sources: src/Language/C/Clang/Internal/FFI.c include-dirs: cbits/ cc-options: -Wall extra-libraries: clang