xlab / c-for-go

Automatic C-Go Bindings Generator for Go Programming Language
https://c.for-go.com
MIT License
1.5k stars 119 forks source link

stdint.h failing #113

Open Nv7-GitHub opened 3 years ago

Nv7-GitHub commented 3 years ago

When compiling with command: c-for-go --ccincl --ccdefs vgo.yml Getting the errors:

processing vgo.yml ⠙/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:20:43: unexpected '<', expected optional argument expression list or one of [&&, '!', '&', '(', ')', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal]
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:175:10: cannot redefine macro using a different replacement list
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:176:10: cannot redefine macro using a different replacement list
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:177:10: cannot redefine macro using a different replacement list
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:178:10: cannot redefine macro using a different replacement list
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:179:10: cannot redefine macro using a different replacement list
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:180:10: cannot redefine macro using a different replacement list
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:208:10: cannot redefine macro using a different replacement list
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:209:10: cannot redefine macro using a different replacement list
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.5/include/stdint.h:210:10: cannot redefine macro using a different replacement list
too many errors

When compiling with the command c-for-go --ccincl vgo.yml Errors:

vgo.c:529:62: undefined: __builtin_object_size
vgo.c:529:62: undefined: __builtin___memcpy_chk
vgo.c:529:62: called object is not a function or function pointer (have '<undefined>')
vgo.c:529:62: called object is not a function or function pointer (have '<undefined>')
vgo.c:529:87: undefined: __builtin_bswap64
vgo.c:529:87: called object is not a function or function pointer (have '<undefined>')
vgo.c:530:62: undefined: __builtin_object_size
vgo.c:530:62: undefined: __builtin___memcpy_chk
vgo.c:530:62: called object is not a function or function pointer (have '<undefined>')
too many errors

Without --ccincl it just says a bunch of headers are missing.

Config:

GENERATOR: 
  PackageName: vgo
  PackageDescription: "Description thing yeah"
  PackageLicense: "Cool licence, check v.mod"
  PkgConfigOpts: []
  Includes: ["vgo.c"]
  Options:
    SafeStrings: true

PARSER: 
  IncludePaths: ["/usr/include", "/usr/local/include"]
  SourcesPaths: ["vgo.c"]

TRANSLATOR: 
  ConstCharIsString: true
  ConstUCharIsString: false
  ConstRules: 
    defines: eval
  PtrTips:
    function:
      - {target: "vorbis_synthesis_pcmout$", tips: [ref,arr]}
      - {target: ^vorbis_, tips: [ref,ref,ref]}
      - {target: ^ogg_, self: arr, tips: [ref,ref]}
  Rules: 
    global: 
      - {transform: lower}
      - {action: accept, from: "^vgo__"}
      - {action: replace, from: "^vgo__", to: _}
      - {transform: export}
    const:
      - {action: accept, from: "^vgo__"}
      - {action: replace, from: "^vgo__", to: _}
    type: 
      - {action: replace, from: "_t$"}
    private:
      - {transform: unexport}
    post-global: 
      - {action: replace, from: _$}
      - {load: snakecase}
nicored commented 3 years ago

Did you end up finding a solution for this? I've got the same issue

Nv7-GitHub commented 3 years ago

No, I didn't find a solution, hoping someone does