You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use this project to generate the bindings of libraw1394.
When using the following description, I got 2 errors after running c-for-go -ccdefs -ccincl -debug -fancy -out=pkg pkg/raw1394.yaml.
GENERATOR:
PackageName: raw1394PackageDescription: "Package raw1394 provides the bindings to the raw1394 library."PackageLicense: "THE AUTOGENERATED LICENSE. ALL THE RIGHTS ARE RESERVED BY ROBOTS."PkgConfigOpts: [libraw1394]SysIncludes: [libraw1394/raw1394.h]PARSER:
IncludePaths: [/usr/include, /usr/include]SourcesPaths: [libraw1394/raw1394.h, libraw1394/ieee1394.h, libraw1394/csr.h]TRANSLATOR:
ConstRules:
defines: expandenum: cgoRules:
global:
- {transform: lower}
- {action: accept, from: "^(raw1394)_"}
- {action: transform, from: "^raw1394_", to: ""}
- {transform: export}type:
- {action: replace, from: "_t$"}private:
- {transform: unexport}post-global:
- {action: replace, from: _$}
- {load: snakecase}
First, the command emits a warning processing pkg/raw1394.yaml ⠙[WARN] cannot gofmt pkg/raw1394/raw1394.go: pkg/raw1394/raw1394.go:422:80: expected '(', found '{' (and 1 more errors)
The generated raw1394.go contains indeed syntax errors:
// Raw1394SetBusResetHandler function as declared in libraw1394/raw1394.h:653funcRaw1394SetBusResetHandler(handleRaw1394Handle, newHBusResetHandler) func{
chandle, chandleAllocMap:=*(*C.struct_raw1394_handle)(unsafe.Pointer(&handle)), cgoAllocsUnknowncnewH, cnewHAllocMap:=newH.PassValue()
__ret:=C.raw1394_set_bus_reset_handler(chandle, cnewH)
runtime.KeepAlive(cnewHAllocMap)
runtime.KeepAlive(chandleAllocMap)
__v:=*NewRef(unsafe.Pointer(&__ret))
return__v
}
After ignoring it with the instruction - {action: ignore, from: ".*handler$"}, the generated go code seems valid but the c helper header cgo_helpers.h gets a syntax error:
./cgo_helpers.h:21:8: error: expected identifier before 'int'
21 | enum {int RAW1394_ISO_OK = C.RAW1394_ISO_OK,
| ^~~
cgo-dwarf-inference:1:17: error: expected '{' before ')' token
here is the generated code:
// raw1394_iso_xmit_handler_t_9440902a is a proxy for callback raw1394_iso_xmit_handler_t.enum {intRAW1394_ISO_OK=C.RAW1394_ISO_OK,
intRAW1394_ISO_DEFER=C.RAW1394_ISO_DEFER,
intRAW1394_ISO_ERROR=C.RAW1394_ISO_ERROR,
intRAW1394_ISO_STOP=C.RAW1394_ISO_STOP,
intRAW1394_ISO_STOP_NOSYNC=C.RAW1394_ISO_STOP_NOSYNC,
intRAW1394_ISO_AGAIN=C.RAW1394_ISO_AGAIN} raw1394_iso_xmit_handler_t_9440902a(structraw1394_handlehandle, unsigned char*data, unsigned int*len, unsigned char*tag, unsigned char*sy, intcycle, unsigned intdropped);
The text was updated successfully, but these errors were encountered:
Hi!
I am trying to use this project to generate the bindings of libraw1394.
When using the following description, I got 2 errors after running
c-for-go -ccdefs -ccincl -debug -fancy -out=pkg pkg/raw1394.yaml
.First, the command emits a warning
processing pkg/raw1394.yaml ⠙[WARN] cannot gofmt pkg/raw1394/raw1394.go: pkg/raw1394/raw1394.go:422:80: expected '(', found '{' (and 1 more errors)
The generated
raw1394.go
contains indeed syntax errors:After ignoring it with the instruction
- {action: ignore, from: ".*handler$"}
, the generated go code seems valid but the c helper headercgo_helpers.h
gets a syntax error:here is the generated code:
The text was updated successfully, but these errors were encountered: