The FFI spec doesn't say exactly which characters may occur in a
header file, so to be on the safe side we'll accept anything that
isn't a space.
mk = CImport cconv safety
- hdr_char c = isAscii c && (isAlphaNum c || c `elem` "._-")
+ hdr_char c = not (isSpace c) -- header files are filenames, which can contain
+ -- pretty much any char (depending on the platform),
+ -- so just accept any non-space character
id_char c = isAlphaNum c || c == '_'
cimp nm = (ReadP.char '&' >> skipSpaces >> CLabel <$> cid)