Skarsnik / gptrixie

A tool to generate NativeCall code from C headers
Artistic License 2.0
26 stars 9 forks source link

Encountered an unknown type "(long double)" #14

Open Xliff opened 4 years ago

Xliff commented 4 years ago

This was encountered when attempting to run it on GraphicsMagick using gptrixie --enums --functions --structs --castxml=c99 api.h -I..

Encountered a non know FundamentalType (long double), either it missing in DG dic or you need to do something specific
  in block  at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/sources/403A5E73B433ECBC2EEF7658DFFA5BFAD92DBDC6 (GPT::DumbGenerator) line 103
Malformed UTF-8 near bytes 6c e9 6d
  in sub extract-func-definition at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/sources/403A5E73B433ECBC2EEF7658DFFA5BFAD92DBDC6 (GPT::DumbGenerator) line 143
  in sub dg-generate-functions at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/sources/403A5E73B433ECBC2EEF7658DFFA5BFAD92DBDC6 (GPT::DumbGenerator) line 155
  in sub MAIN at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/resources/E1C3516BEF69276E7298DB57A82D9E0553314ECD line 161
  in block <unit> at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/resources/E1C3516BEF69276E7298DB57A82D9E0553314ECD line 16
  in sub MAIN at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/bin/gptrixie line 3
  in block <unit> at /home/cbwood/Projects/rakudobrew/versions/moar-blead/install/share/perl6/site/bin/gptrixie line 1
Skarsnik commented 4 years ago

The true error is actually the malformed utf8 one. I doubt the file has weird utf8 character in it, or maybe it's opening a weird/invalid file. I will try to have a look today

Skarsnik commented 4 years ago

skarsnik@debian:~/perl6/gptrixie$ /home/skarsnik/perl6/rakudo-2019.11/install/bin/perl6 -e 'my $fh = open "/usr/include/GraphicsMagick/magick/cdl.h"; say $fh.lines' Malformed UTF-8 near bytes 6c e9 6d in block <unit> at -e line 1 it's super weird, it comes from the line 6 with an a é. skarsnik@debian:~/perl6/gptrixie$ chardetect3 /usr/include/GraphicsMagick/magick/cdl.h /usr/include/GraphicsMagick/magick/cdl.h: ISO-8859-1 with confidence 0.73 I am not sure what I can do about that?

Xliff commented 4 years ago

Huh!

OK, so thanks for at least determining the problem. Maybe I can work around it?

Skarsnik commented 4 years ago

Maybe it's a Raku bug? I don't know how it's supposed to handle file encoding

Skarsnik commented 4 years ago

If you have your own copy of the headers, I guess you can remove this line ^^